Question: please complete the items that say Change Here Thank you, typed answers only please here is text to fill out if you want : int

 please complete the items that say "Change Here" Thank you, typedanswers only please here is text to fill out if you want

please complete the items that say "Change Here" Thank you, typed answers only please

here is text to fill out if you want :

int main() {

classSection class1("Beginning Programming", 12345);

classSection class2("Programming I", 13579);

// (2.5 points) Declare and initialize the pointer pclass1 to the address of class1 and pclass2 to the address of class2

classSection *pclass1 = &class1;

classSection *pclass2 = &class2;

// (2.5 points) Set the numberOfStudents field of class1 to 30 using class. access method

class1.numberOfStudents = 30;

// (2.5 points) Set the numberOfStudents field of class2 to 25 using pointer-> access method

class2.numberOfStudents = 25;

// (2.5 points) Change the CRN field of class2 to 24680 using dereference operator* with pointer

// and . access method

"(Change Here)" = 24680;

// (2.5 points) Set the averageScore of class1 to 87.5 with class. access method with the help of

// setAverageScore function

"(Change Here)"setAverageScore(87.5);

// (2.5 points) Set the averageScore of class2 to 82.0 with pointer-> access method with the help

// of setAverageScore function

"(Change Here)"setAverageScore(82.0);

// (2.5 points) Print the averageScore of class1 with pointer-> access method and with the help of

// getAverageScore function

cout

// (2.5 points) Print the averageScore of class2 using dereference operator* with pointer and . access

// method and with the help of getAverageScore function

cout

return 0;

}

#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() { classSection class1("Beginning Programming", 12345); classSection class2("Programming I", 13579); // (2.5 points) Declare and initialize the pointer pclass1 to the address of class1 and pclass2 to the address of class2 classSection *pclass1 = &class1; classSection *pclass2 = &class2; // (2.5 points) Set the numberOfStudents field of class1 to 30 using class. access method class1. numberOfStudents = 30; // (2.5 points) Set the numberOfStudents field of class2 to 25 using pointer-> access method class2.numberOfStudents = 25; II (2.5 points) Change the CRN field of class2 to 24680 using dereference operator* with pointer // and , access method "(Change Here)" = 24680; II (2.5 points) Set the averageScore of class1 to 87.5 with class. access method with the help of setAverageScore function (Change Here)"setAverageScore(87.5); II (2.5 points) Set the averageScore of class2 to 82.0 with pointer-> access method with the help of setAverageScore function (Change Here)"setAverageScore(82.0); // (2.5 points) Print the averageScore of class1 with pointer-> access method and with the help of // getAverageScore function cout

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!