I posted this one earlier, but no go......I'm getting an error for the constructor definition StudentRecord::StudentRecord() that it cannot return a value. This was running until I did some rearranging to try to get my function that calculates the total grade average in main to work.(So i commented that all out, and now this constructor problem)
Any help please,
Thank you
RG
#include <iostream>
using namespace std;
class StudentRecord
{
private:
double quizzes, final, midterm, total_grade;
char letter_grade;
public:
StudentRecord();
void letter_assignation(char letter_grade, double final_grade);
void total_analyzer(double total_grade);
double quiz_maker(double quiz1, double quiz2);
double finalizer(double final);
double midtermer(double midterm);
//double get_quiz();
//double get_final();
//double get_midterm();
//void get_final_numeric(double numeric);
}
StudentRecord::StudentRecord()
{
total_grade = 0;
quizzes = 0;
final = 0;
midterm = 0;
letter_grade = 0;
}
void StudentRecord::total_analyzer(double total_average)
{
total_grade = total_average;
total_average = (quizzes * .25) + (midterm * .25) + (final * .50);
}
void StudentRecord::letter_assignation(char letter_maker, double numeric_grade)
{
letter_grade = letter_maker;
if(numeric_grade < 60)
{
letter_maker = 'F';
}
else if((numeric_grade <= 70) && (numeric_grade > 60))
{
letter_maker = 'D';
}
else if((numeric_grade < 80) && (numeric_grade > 70))
{
letter_maker = 'C';
}
else if((numeric_grade >= 80) && (numeric_grade < 90))
{
letter_maker = 'B';
}
else if(numeric_grade >= 90)
{
letter_maker = 'A';
}
}
double StudentRecord::quiz_maker(double quizz1, double quizz2)
{
quizzes = (quizz1 + quizz2)* 10;
return quizzes;
}
double StudentRecord::midtermer(double midterm_grade)
{
midterm = midterm_grade;
return midterm;
}
double StudentRecord::finalizer(double final_grade)
{
final = final_grade;
return final;
}
//void StudentRecord::get_final_numeric(double numeric)
//{
//total_grade = numeric;
// }
int main()
{
double Quizz1, Quizz2, Midterm, Final, total_numeric, numeric1;
StudentRecord GradeMachine;
cout << "Please enter your first quiz grade 1 - 10: " << endl;
cin >> Quizz1;
cout << "Please enter your second quiz grade 1 - 10: " << endl;
cin >> Quizz2;
GradeMachine.quiz_maker(Quizz1, Quizz2);
cout << "Please enter your midterm grade: " << endl;
cin >> Midterm;
GradeMachine.midtermer(Midterm);
cout << "Please enter your final grade: " << endl;
cin >> Final;
GradeMachine.finalizer(Final);
//GradeMachine.total_analyzer(total_numeric);
//GradeMachine.get_final_numeric(numeric1);
//numeric1 = total_numeric;
//cout << "Your total grade average is: " << total_numeric << endl;
return 0;
}