Using Overloaded Constructors
Student(int k, double h, double q, double e); <--------- is the overloaded constructor
1 2 3 4 5 6 7
|
class Student
{
int studentID;
int HomeworkAvg;
int QuizAvg;
int ExamAvg;
};
|
up there is how I declared an object of the class 'Student'
now I need to use the overloaded constructor to pass in 84551 for the studentID, 78.5 for the HomeworkAvg, 87.25 for QuizAvg, and 77.0 for the ExamAvg
where's the constructor in that class. What's the problem at all?
pseudo-code:
Student s( <param1>, <param2>, ... <paramN> );
You have multiple problems in the class
1) overloaded constructor is not delcared in the class
2) the data types are mismatching ( you declared all you data members as int )
Topic archived. No new replies allowed.