C++ Programming Assignment: Object-Oriented Programming in C++
VerifiedAdded on 2019/09/18
|3
|781
|323
Homework Assignment
AI Summary
This C++ programming assignment comprises three distinct problems designed to reinforce object-oriented programming concepts. The first problem involves creating a `VehicleWarranty` class, incorporating private variables for vehicle details, warranty length, and a constant for the current year. Students are tasked with implementing public getter and setter functions, along with a function to calculate warranty validity. The second problem centers on a `Person` class with private variables for name and campus, along with public getter and setter functions and a display function. An array of `Person` objects is created and populated with hardcoded data. The final problem extends the `Person` class, introducing `Student` and `Staff` classes through inheritance. Students are required to add specific variables (ID, major, department) to the derived classes and implement appropriate getter, setter, and display functions. In the `main` function, one `Student` object and one `Staff` object are created, with user input gathered to populate their respective data, which is then displayed using the display functions. The objective is to demonstrate understanding of classes, objects, inheritance, and polymorphism in C++ programming.
1 out of 3