Question
In C++ please complete the following tasks to receive full credits and great ratings Task 1: Create a base class called Person , which has
In C++ please complete the following tasks to receive full credits and great ratings
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 class Student 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started