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;
classSection(string cname, int crn){
courseName = cname;
CRN = crn;
}
double getAverageScore(){
return averageScore;
}
void setAverageScore(double avgScore){
averageScore = avgScore;
}
};
int main(){
//Declare two variables class1 and class2, that are instances of classSection class
//Initialize the two variables using proper values
// To Do (1 point)
// Declare and initialize the pointer pclass1 to the address of class1 and pclass2 to the address of class2
// To Do (1 point)
// Set the numberOfStudents field of class1 to 30 using class. access method
// Set the numberOfStudents field of class2 to 25 using pointer-> access method
// To Do (1 points)
//Change the CRN field of class2 to 24680 using dereference operator* with pointer and . access method
// To Do (1 point)
//Set the averageScore of class1 to 87.5 with class. access method with the help of setAverageScore function
//Set the averageScore of class2 to 82.0 with pointer-> access method with the help of setAverageScore function
// To Do (1 points)
// Print the averageScore of class1 with pointer-> access method and with the help of getAverageScore function
// To Do (1 point)
//Print the averageScore of class2 using dereference operator* with pointer and . access method and with the help of getAverageScore function
// To Do (1 point)
return 0;
}
 #include #include using namespace std; class classSection { private: double averageScore;

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!