How do I create an array of a grade class variable. I don't understand how to initialize and what to write in main(). from this, is there a way to make a constant? And do I need a for loop to read and output the array? Thanks
class First
{
public:
int getId();
void setId(int);
int getExam();
void setExam(int);
void print();
First(int studentId, int exam);
private:
int id;
int grade;
};
int main()
{
int studentId = 0;
int exam = 0;
First Student(studentId, exam);
cout << "Enter student id" << endl;
cin >> studentId;
Student.setId(studentId);
cout << "enter grade" << endl;
cin >> exam;
Student.setExam(exam);
Student.print();
return 0;
}