Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is the Person class: #include #include using namespace std; class Person { private : string Name; string Campus; public : void setName(string Name) {

image text in transcribed

Here is the Person class:

#include  #include  using namespace std; class Person { private: string Name; string Campus; public: void setName(string Name) { this->Name = Name; } void setCampus(string Campus) { this->Campus = Campus; } void display() { cout int main() { Person people[5]; people[0].setName("david");people[0].setCampus("MIT"); people[1].setName("brendon");people[1].setCampus("Harvard"); people[2].setName("nick"); people[2].setCampus("standford"); for(int i = 0; i return 0; }
Create a C++ program (3 points): o At the top of the file include the following comments . Your name .The purpose (core concept found below) of the program . The date created o Using the Person class from Assignment 12 - Modify the Person class -Set all variables so they are accessible by the Person class and all sub classes (not by any other class or program) - Create a Student class - Student inherits from Person .Add variables for ID and major. Set all variables so they are only accessible from the Student class ID should be of type int - Add set functions for ID and major. Set the accessiblity so they can be accessed from anywhere - Add a function to display all information for the Student. This includes information inherited from Person. Create a Staff class - Staff inherits from Person - Add variables for ID and department. Set all variables so they are only accessible from the Staff class ID should be of type string Add set functions for ID and department. Set the accessibility so they can be accessed from anywhere - Add a function to display all information for the Staff member. This includes informatino inherited from Person . In main -Create one ojbect of type Student and one object of type Staff -Gather all input for Student (name, campus, ID, major) from the user and use the set functions to set the values for the object. - Display the information for the student. Gather all input for the staff member (name, campus, ID, department) from the user and use the set functions to set the values for the object. - Display the information for the staff member o Compile and run your code Create a C++ program (3 points): o At the top of the file include the following comments . Your name .The purpose (core concept found below) of the program . The date created o Using the Person class from Assignment 12 - Modify the Person class -Set all variables so they are accessible by the Person class and all sub classes (not by any other class or program) - Create a Student class - Student inherits from Person .Add variables for ID and major. Set all variables so they are only accessible from the Student class ID should be of type int - Add set functions for ID and major. Set the accessiblity so they can be accessed from anywhere - Add a function to display all information for the Student. This includes information inherited from Person. Create a Staff class - Staff inherits from Person - Add variables for ID and department. Set all variables so they are only accessible from the Staff class ID should be of type string Add set functions for ID and department. Set the accessibility so they can be accessed from anywhere - Add a function to display all information for the Staff member. This includes informatino inherited from Person . In main -Create one ojbect of type Student and one object of type Staff -Gather all input for Student (name, campus, ID, major) from the user and use the set functions to set the values for the object. - Display the information for the student. Gather all input for the staff member (name, campus, ID, department) from the user and use the set functions to set the values for the object. - Display the information for the staff member o Compile and run your code

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_2

Step: 3

blur-text-image_3

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

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

What is the impact of zero step cost in A * algorithm

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago