I am coming from java programing and I really do not have a clue what I am doing in C++. If someone can please help me I would greatly appreciate it. I have included the code below, there are nine things that I am missing. someone please help me.
Code:
void processGrades(istream &in, ostream &out);
int main()
{
processGrades(cin, cout);
return 0;
}
void processGrades(istream &in, ostream &out)
{
char choice = ' ';
int studentGrade = 0;
int curvedGrade;
double shift;
double curve;
double average;
//loop until they select quiz
while (choice != '4')
{
//print a menu
out << "\n\nChoose a type of curve:\n"
<< "1. Shift Curve\n"
<< "2. Krider Curve\n"
<< "3. Center Curve\n"
<< "4. Quit" << endl;
in >> choice; //read menu option (1, 2, 3, 4)
//don't do anything if Quit was chosen
//if the user entered a bad selection, it will skip this and just
//print the menu again.
if (choice >= '1' && choice <= '3')
{
shift = 0;
curve = 0;
average = 0;
//read the values to be used with that curve picked
if (choice == '1' || choice == '2')
{
//both shift and Krider curves need a shift value
shift = readShift(in, out);
}
if (choice == '2' || choice == '3')
{
//both Krider and center curves need a curve value
curve = readCurve(in, out);
}
if (choice == '3')
{
//the center curves need a class average
average = readAverage(in, out);
}
//read in a value before we start processing
studentGrade = readStudentGrade(in, out);
while (studentGrade >= 0)
{
//pick the type of curve that will be applied
switch (choice) {
case '1':
curvedGrade = shiftCurve(studentGrade, shift);
break;
case '2':
curvedGrade = kriderCurve(studentGrade, curve, shift);
break;
case '3':
curvedGrade = centerCurve(studentGrade, curve, average);
break;
}
//output the results
writeResult(out, studentGrade, curvedGrade);
//read in the next grade
studentGrade = readStudentGrade(in, out);
}
}
}
}