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

PROBLEM 3 Start from the solution program of Problem 2 of Homework 2. Modify the

ID: 3846900 • Letter: P

Question

PROBLEM 3

Start from the solution program of Problem 2 of Homework 2. Modify the program as follows a) 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. b) Modify the mutator function (that you wrote in 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. c) write a destructor function to clear the dynamic array for test scores. d) write a copy constructor function that creates a duplicate copy of a Student object e) Overload the assignment operator to assign one Student object to another.| f) In your main function, create a dynamic array of Student objects. Prompt the user for the size of the dynamic array. g) Demonstrate the accessor and mutator functions for each Student object. h) 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. i) 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. Start from the solution program of Problem 2 of Homework 1. Modify the program as follows: a) Remove the variable for GPA from your code, you will not need it for this problem. b) Remove the initializing conductor, you will riot need it for this problem. c) Create an integer array named score to store the exam scores from 5 tests as a private member. d) Create a double named average to store the average across the 5 test scores as a private member. e) Modify the accessor and mutator functions to get and set the values for the exam scores and the average score. The mutator function needs to get the Individual test scores from the user and calculate the average score, the accessor function needs to display the individual scores as well as the average score. f) In vow main function, declare a static array of 5 students. g) Demonstrate the use of the accessor and mutator functions you create in Problem 2(d) for each of the students you created in Problem 2(e), using a loop of your choice. Design a doss for complex numbers called Complex. It must have two private variables- one for the real part and one for the imaginary part of the complex number. Ohm rite appropriate constructor, accessor and mutator functions to create, get and set the objects and member variables. Implement the following for the class. a) A friend function that alpha dds two Complex objects and returns the sum as a Complex object to be assigned to a different Complex object. b) A member function that accepts another Complex object as an argument, computes the sum, and returns the sum as a Complex object to be assigned to a different Complex object. c) Write operator overloading functions for + (plus), -(minus) and *(multiply) to perform addition, subtraction and multiplication of complex numbers. Your functions must accept two constant Complex objects passed by reference d) write operator overlook a ding functions for > > and and

Explanation / Answer

#include using namespace std; struct student { char name[50]; int roll; float marks; } s[10]; int main() { cout
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