Computers and Technology

You are going to write a program which will contain the following objects using inheritance. The objects are Person, Student, Undergraduate and Graduate Student Person will contain the instance variable name, Student will inherit from Person and will contain student ID number, Undergraduate will inherit from Student and will contain grade level (freshmen, sophomore, junior or senior) and Graduate Student will inherit from Student and contain its major. Each class will contain a print method (called print) which will print out all information about the object (including the information it inherits).
In undergraduate and graduate, the classes will also include a method called equals which will determine if an undergraduate is the same grade level as another (passed in as a parameter) comparing its level and if a Graduate Student has the same major.
Allow the user to input an array of Person (max 10) and perform the following operations,
Print all Persons
Print all Students
Print all Undergraduates
Print all Graduate Students
Input a Grade Level or Major and print those Persons already in the array that have the same grade or major.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, sayedaly2096
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
image
Computers and Technology, 22.06.2019 17:00, DRock4976
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen too
Answers: 2
image
Computers and Technology, 22.06.2019 20:00, Jana1517
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i. e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
image
Computers and Technology, 23.06.2019 09:30, rscvsdfsrysas3712
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
Do you know the correct answer?
You are going to write a program which will contain the following objects using inheritance. The obj...

Questions in other subjects:

Konu
Mathematics, 27.01.2021 17:40