Homework 2

2020_S19/wk2/hw2.cpp

The purpose of this assignment is to review basic fundamentals of OOP, class definition, constructors, destructor, accessors, mutators, for a simple Student class definition containing a dynamic member variable. This assignment will review on how to modify an existing class definition, to handle memory managment by defining the default constructor, copy constructor, destructor, and overloaded assingment operator.

Requirements

You will be given function main to leave as is. Your task is to write the Student class definition w/ constructor, destructor, overloaded assignment operator, and member function prototypes, and then define the all the member functions listed below outside of the class definition (review Scope::Resolution Operator).

hw2.cpp
Testing Default Constructor, input and print

Enter student's fname: John
Enter student's lname: Doe
How many tests? 3
Enter test score #1: 88
Enter test score #2: 87
Enter test score #3: 86
Student s
John Doe
Test #1: 88
Test #2: 87
Test #3: 86
Test Average: 87.00

Testing Copy Constructor
Student m
John Doe
Test #1: 88
Test #2: 87
Test #3: 86
Test Average: 87.00

Testing m.setTestAtIndex(99,0)
Student m  **changed
John Doe
Test #1: 99
Test #2: 87
Test #3: 86
Test Average: 90.67

Student s **unchanged
John Doe
Test #1: 88
Test #2: 87
Test #3: 86
Test Average: 87.00

Testing Overloaded Assignment Operator
Student n
Sally Sue
Test #1: 44
Test #2: 87
Test #3: 86
Test Average: 72.33

Student m
John Doe
Test #1: 99
Test #2: 87
Test #3: 86
Test Average: 90.67

Once completed, submit to your depository directory
2020_S19/wk2/hw2.cpp.

If you have any questions, ask me during office hours, before class, after class, email me, call me, or find me and I'd be happy to help. Also, there's the walk-in lab (SCI III rm 324) where there are tutors there to help if you cannot reach me.