Question: Write a C++ class definition called SIMPLEST_GRADES defined as follows: class SIMPLEST_GRADES { public: // public methods for this class SIMPLEST_GRADES (int, int) ; //

Write a C++ class definition called SIMPLEST_GRADES defined as follows:

class SIMPLEST_GRADES {

public: // public methods for this class

SIMPLEST_GRADES (int, int) ; // constructor;

// example usage : g.SIMPLEST_GRADES (x,y) ;

// create an object called g with x students each with y exams ;

void SIMPLEST_LIST (int) ; // a method ;

// example usage : g.SIMPLEST_LIST (x) ;

// if x is 1, list the student ids ;

// if x is 2, list the student ids and exam grades;

// if x is -1, list the student ids in reverse order ;

// if x is -2, list the student ids and exam grades in reverse order ;

// return no values ;

void SIMPLEST_AVE (int) ; // another method ;

// example usage : e.SIMPLEST_AVE (x) ;

// find the average grade for exam x ;

// returns no values ;

protected: // protected var to be used by this class and its derivative

// classes only (not from main)

int n ; // no of students ;

int e ; // no of exams ;

int id [20] ; // an integer array to hold the ids ;

int exam_grades [20] [3] ; // 2-dim array to hold exam grades ;

} ;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!