Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Change the array for test scores to dynamic array. Add a private member variable

ID: 3847316 • Letter: C

Question

Change the array for test scores to dynamic array. Add a private member variable called number_of_scores to store how many tests a student took. Modify the mutator function (that you wrote m Problem 2(e)) to set the value for number of scores and test scores to integrate the dynamic array definition. Prompt the user for the value of number_of_scores. Write a destructor function to dear the dynamic array for test scores. Write a copy constructor function that creates a duplicate copy of a Student object. Overload the assignment operator to assign one Student object to another. In your main function, create a dynamic array of Student objects Prompt the user for the size of the dynamic array. Demonstrate the accessor and mutator functions for each Student object. Create a Student object by using the copy constructor. Use the first object in the dynamic array as the source Verify that the copy is successful by using the accessor functions. Create a Student object by using the default constructor Assign the second object in the dynamic array as source to this object. Verify that the assignment is successful by using the accessor functions.

Explanation / Answer

#include <cstdlib>

#include <iostream>

using namespace std;

const unsigned long MAX_SIZE = 20;

typedef int ItemType;

class Heap {

private:

ItemType array[MAX_SIZE];

int elements; //how many elements are in the heap

public:

Heap( )

~Heap( )

bool IsEmpty( ) const

bool IsFull( ) const

Itemtype Retrieve( )

void Insert( const Itemtype& )

};

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote