I'm working on writing a grade program with 2 quizes, one midterm and one final exam. I need the program to ask for the data, output it back out and include the average numeric score and a final letter grade. I have to use a structure. So far, I have the structure and it asks for the data but it won't output anything. I have not yet tried to work on the output of a letter grade. Here's what I have so far. What am I missing to get it to output everything.
using namespace std;
struct studentRecord // collection of student grades
int quiz1, quiz2;
double midterm, finalExam, quizAve, score;
A few problrems here.
1) Your function doesn't return anything.
2) You're not using the return value, so why declare the function as returning a double?
3) The values you calculate in the function are all local and are lost when the function exits.
youare29 posted a calc function which tries to update studentRecord, but there is a problem with his code. grades is passed by value, therefore any changes to the struct are local and are lost when calcResults exits. Changing the function to pass grades by reference will fix the problem.