#include <iostream> using namespace std; class Student { public: Student(); Student (int, int, int, int); double quizAverage(); double finalGrade(); void displayGrade()const; private: int id; int quiz1; int quiz2; int finalExam; }; Student::Student() { id= 0; quiz1= 40; quiz2= 40; finalExam= 40; } Student::Student(int ID ,int QUIZ1 ,int QUIZ2,int FINAL) { id= ID; quiz1= QUIZ1; quiz2= QUIZ2; finalExam= FINAL; } double Student::quizAverage() { double average; average = (quiz1 + quiz2)/2; return average; } double Student::finalGrade() { double finalgr; finalgr = (quizAverage() + finalExam)/2; return finalgr; } void Student::displayGrade()const { cout<<"The student's ID is:\t"<<id<<endl; cout<<"The final grade is:\t"<<finalGrade()<<endl; }
<code>
const
finalGrade
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)