Question: #include #include using namespace std; class classSection { private: double averageScore; public: string courseName; int CRN; int numberOfStudents; classSection ( string cname, int crn )
#include
#include
using namespace std;
class classSection
private:
double averageScore;
public:
string courseName;
int CRN;
int numberOfStudents;
classSectionstring cname, int crn
courseName cname;
CRN crn;
double getAverageScore
return averageScore;
void setAverageScoredouble avgScore
averageScore avgScore;
;
int main
Declare two variables class and class that are instances of classSection class
Initialize the two variables using proper values
To Do point
Declare and initialize the pointer pclass to the address of class and pclass to the address of class
To Do point
Set the numberOfStudents field of class to using class. access method
Set the numberOfStudents field of class to using pointer access method
To Do points
Change the CRN field of class to using dereference operator with pointer and access method
To Do point
Set the averageScore of class to with class. access method with the help of setAverageScore function
Set the averageScore of class to with pointer access method with the help of setAverageScore function
To Do points
Print the averageScore of class with pointer access method and with the help of getAverageScore function
To Do point
Print the averageScore of class using dereference operator with pointer and access method and with the help of getAverageScore function
To Do point
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
