Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ Labs are held in a closed environment such that you may ask your TA questions. Please use your TAs knowledge to your advantage.

IN C++

Labs are held in a closed environment such that you may ask your TA questions. Please use your TAs knowledge to your advantage. You are required to move at the pace set forth by your TA. Please help other students in need when you are finished with a task. You may work in pairs if you wish. However, I encourage you to compose your own solution to each problem. Have a great time! Labs are a vital part to your education in CptS 122 so work diligently.

I highly encourage you to work in teams for these tasks!

Tasks:

Task 1: Create a base class called Person, which has private data members for a name, age, gender, and height. Implement a constructor, copy constructor, destructor, overloaded assignment operator, overloaded stream insertion and extraction operators, and getters and setters. See Task 2 for testing this class.

Task 2: Create a derived class called TestPerson, which publically inherits from class Person. Create test methods for each method in class Person. Remember these functions should not accept any parameters or return any values. However, they should print messages for test case passed or test case failed.

Task 3: Modify your class Person so that the data members are protected instead of private. How does this affect the tests cases that you created in Task 2?

Task 4: Create a derived class called Student, which publically inherits from class Person. Add three private data members to class Student. These include an array of struct Course, the number of courses taken, and the total number of credits. The struct Course should contain a string for course name, credits assigned to course, and current grade in course. Implement appropriate constructors, overloaded operators, and setters and getters for this class. Also, implement methods for computing total credits taken and current GPA. How would your implementation change if you decided to define a class Course instead of struct Course?

Task 5: Create a derived class called Teacher, which publically inherits from class Person. Add three private data members to class Teacher. These include an array of struct Course, the number of courses taken, and the total number of credits. The struct Course should contain a string for course name, credits assigned to course, and average grade of students in course. Implement appropriate constructors, overloaded operators, and setters and getters for this class. Also, implement methods for computing total credits taught and average grades of students across the courses taught. How would your implementation change if you decided to derive class Teacher from classStudent instead of class Person?

Task 6: Create an application, which allows students to register for classes taught by a particular teacher.

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

Step: 3

blur-text-image

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

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

ISBN: 1461368332, 978-1461368335

More Books

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago