I just started getting into C++; this is a simple assignment but there's something about calculations and even a character issue here that I can't figure out.
The catch of the assignment is to input quiz grades for a student, input the weight the quiz has on the total grade, calculate the student's final grade by getting the average, and then assigning a letter grade (this is the character part).
My input function also calls the calc_ave and calc_letter functions to assign a letter grade and final average for that student. The inputs themselves work, but then I have these lines of code and this is when things get screwy.
Student::avweight = calc_ave();
Student::lettergrade = calc_letter();
avweight comes out to be something stupid like 2800 or something, and then lettergrade just doesn't appear at all (it's a blank space where there should be a letter). I'll show the functions so I can make any appropriate corrections concerning what may have gone wrong.
So basically the inputs for the student work, but when I call the calc_ave and calc_letter functions, I print out the values and the letter grade comes up as a blank space while calc_ave gives some number that is way off.
EDIT: Here's sample output to show what I'm talking about
The catch of the assignment is to input quiz grades for a student, input the weight the quiz has on the total grade, calculate the student's final grade by getting the average, and then assigning a letter grade (this is the character part).
My input function also calls the calc_ave and calc_letter functions to assign a letter grade and final average for that student. The inputs themselves work, but then I have these lines of code and this is when things get screwy.
Student::avweight = calc_ave();
Student::lettergrade = calc_letter();
avweight comes out to be something stupid like 2800 or something, and then lettergrade just doesn't appear at all (it's a blank space where there should be a letter). I'll show the functions so I can make any appropriate corrections concerning what may have gone wrong.
So basically the inputs for the student work, but when I call the calc_ave and calc_letter functions, I print out the values and the letter grade comes up as a blank space while calc_ave gives some number that is way off.
EDIT: Here's sample output to show what I'm talking about


Comment