# Thread: problems with calculating a students grade

1. Member Join Date
Oct 2016
Posts
13
Rep Power
0

## problems with calculating a students grade

Hi so I have a program which should calculate a students grade with tests that have different weights. My issue is that it isn't calculating correctly.

{

if (gradeNumber <= 100)
{
gradeNumber = (((quizScore1 + quizScore2 + quizScore3) * .25) + (midtermScore * .35) + (finalScore * .4));
}

}
Last edited by javanewbie82; 11-21-2016 at 10:07 PM.  Reply With Quote

2. Member Join Date
Oct 2016
Posts
13
Rep Power
0

## Re: problems with calculating a students grade

Quiz one = 9
Quiz two = 7
Quiz three = 9
Midterm score = 40
Final exam score = 50
Student's grade = 40.25
Letter grade = F  Reply With Quote

3. ## Re: problems with calculating a students grade

because of integer division
Where is there any division? I don't see it in the posted code.  Reply With Quote

4. Member Join Date
Oct 2016
Posts
13
Rep Power
0

## Re: problems with calculating a students grade

Oh you're right, I thought maybe multiplying the ints by a double would result in cutting it off. I am unsure then why it is resulting in the erroneous score. I think I might have figured out part of the problem...I probably need a maximum score?  Reply With Quote

5. Member Join Date
Oct 2016
Posts
13
Rep Power
0

## Re: problems with calculating a students grade

Oh I feel dumb I misread the point values. How do I delete posts on here XD  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•