Dear Megha,
Although, most of the things already has been explained by sunandalawania. But, there are other criteria also which can change these calculation process.
So, it is better to do as suggested by Jeevarathnam and any doubt can be further placed here for discussion.
Keep doing search and increase your knowledge. Because, knowledge brings confidence.
And confident candidate are always awarded by good opportunities. Best of Luck.