why don't u search th internet using google "what is stock exchange index?", "how is stock exchange index calculated?" . you will surely find the answers to your questions.
an index is the weighted average of the prices of shares of companies included in the index. example say if today prices of company a,b and c increase by Rs. 100, 50, and 20 respectively and their weights in the index are 50% 30% and 20% respectively( presuming that the index is made up of these 3 companies only) then the index will increase by 69 points (100x50%+50x30%+20x20%=50+15+4=69 points)
just like we calculated the index in the above example for 3 companies, the sens*x is an index constituting of 30 companies and nifty of 50 companies. full form of sens*x is sensitive index and of nifty is national fifty.
the 50 and 30 companies chosen for calculating index are big representative companies from various sectors (examples of sectors- steel, cement, realty, telecom,FMCG etc) so thet the index movements provide a representation of the market movements as a whole.
price of a share is determined by it's demand and supply...you should also search "fundamental analysis" "technical analysis" "dow jones theory"