I am attempting to make a GPA calculator for a school project.
I ask the user for their letter grade, whether the class is weighted or not and if the letter grade was a + or regular grade (A+ or A). The scale is from 4 to 0. If the class is weighted, the scale is from 5 to 1. If the grade received was an + grade (A+/B+/etc.), it adds 0.5 to the grade.
In order to find the number of points from a class, I used the following formula:
totalPointsFromClassOne=(1*weightedScoreForOne)+(0 .5*plusGradeForOne)+int(classOneGrade);
When I tested it (weighted A+), the answer should have been 5.5; however, I got the answer 98.5. I assigned A as 4, B as 3, C as 2, D as 1 and F as 0. I think it's having trouble converting the user input (the letter grade) and converting it to the assigned number. Can someone please help me solve this problem?
I am a beginner, if you haven't noticed =P.