I am trying to calculate percentage, and my results are not correct. Suppose a Student Scores 18.70 out of 30 in Subject1 & 29.75 out of 40 in Subject2.
I have calculated percentage of Subject1 as 62.33% & for Subject2 74.38%.
While calculating the final percentage If I average both percentages I get 68.35% but If I calculating the percentage by adding scores of both Subjects i.e. 48.45 out of 70 the percentage is 69.21%.
I know know 69.21% is correct but I fail to understand why average is coming wrong, and is there any way with which I can get final percentage from percentages in each subject.
I know I am very bad in math,
be gentle.

try this if it makes sense;
18.7 + 29.75=48.45 this is your total score out of 70 right,
now lets assume you have the first test 5/5 and the second 43.45/65 which is 48.45/70....the same value right? 
but if you do the percentage now its (100%+66.8%)/2=83.4% 
you are giving a different weight from from different measurments the same weight and consequently influencing the final value. I would simply add numerators and denominator and then calculate the final percentage or do what Jose Luis said above to account for the differnt weights of measurments.  
