Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions

Question

What is Aufbau's rule explain with example?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago