Question: In Q1, you have to write the function definitions that is, the implementation of the functions listed in the class. So totally you have to

 In Q1, you have to write the function definitions that is,
the implementation of the functions listed in the class. So totally you
In Q1, you have to write the function definitions that is, the implementation of the functions listed in the class. So totally you have to write 5 functions: 3 constructors (2 regular, 1 copy), 1 destructor, and 1 classesAtIndex . No need to write main function, to create the object of the class.
classes is a dynamic array which has the students as indexes and the number of classes the students take, as values. For example, if classes was a 100 int array, you have a record of 100 students, where classes[0] will be the number of classes the first student has taken, classes[77] will be the number of classes the 78th student has taken, etc.
classesAtIndex should return the number of classes the (index)th student has taken.

The following class keeps track of how many students are at College A and the number of classes each of them have taken in Spring 2020. The classes for each student are positive values of type unsigned int and are stored as a dynamically allocated array. The first data member is a pointer that will point to the first element of the array. This array will be of an arbitrary size. The default size of the array shall be 50, but may be specified by the user at the time of construction The second data member represents the size of the array, i.e. the number of students at College, and is stored as unsigned int. class Spring 2020 private: unsigned int* classes; unsigned int num; public: // constructors (default, one arg, and copy) Spring2020 (); Spring2020 ( unsigned int numberOfStudents); Spring2020 ( const Spring2020& original); // destructor -Spring2020 (); // Member function int classesAt Index ( int index); 1) If this is in the Class Specification (header) file Spring2020. hpp, write the function definitions that would be in the Class Implementation (source) file Spring2020.cpp. in) Why must the parameter of the copy constructor be of type constant reference? Hint: Recall the discussion in class about constant reference. But this question seeks answers beyond that. Here we are passing constant reference, but as parameter to a copy constructor In Q1, you have to write the function definitions that is, the implementation of the functions listed in the class. So totally you have to write 5 functions: 3 constructors (2 regular, 1 copy), 1 destructor, and 1 classesAtIndex. No need to write main function, to create the object of the class. classes is a dynamic array which has the students as indexes and the number of classes the students take, as values. For example, if classes was a 100 int array, you have a record of 100 students, where classes [O] will be the number of classes the first student has taken, classes[77] will be the number of classes the 78th student has taken, etc. classesAtIndex should return the number of classes the (index)th student has taken

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!