C++ Assignment: Implementing Person, Student, and Staff Classes in C++
VerifiedAdded on 2019/09/13
|2
|497
|197
Homework Assignment
AI Summary
This assignment focuses on object-oriented programming in C++ and involves creating three classes: Person, Student, and Staff. The first part of the assignment requires creating a Person class with attributes for name and campus, along with methods to set and display this information. An array of Person objects is initialized, and data is hardcoded for three individuals. The second part extends the Person class through inheritance. The Student class inherits from Person and includes attributes for ID and major. The Staff class also inherits from Person and includes attributes for ID and department. Both Student and Staff classes have methods to set and display their respective data. The program then creates one Student and one Staff object, gathers input from the user for their attributes, and displays the information for both objects. The assignment emphasizes the use of inheritance, encapsulation, and the implementation of methods to manage and display data associated with each class.
1 out of 2