Start a new topic

Please tell me hot to get sum of values of multiple variables at a time

I want to make a percentage calculator 

So i have to add the marks of a student out of 100 in 6 subjects, The screenshot given

below was my trick.I thought it would work but it gave me the wrong sum of marks.


You are requested to tell me about this so that I can complete my app.

image


When you direct take data from the textbox and tried to sum them they will be concatenated.
The solution for this is first converted to int then add them.

image


but my app is still giving wrong  percentage. Given below is my code. Can you find out any fault in my coding

image

Yes. The formula you have used is to calculate the Average. Please use percentage formula to calculate percentage.
Percentage = (Scored marks ÷ Out of marks) × 100
Login to post a comment