(C++ Program) You are to write a program which is going to use inheritance. It s
ID: 3756172 • Letter: #
Question
(C++ Program)
You are to write a program which is going to use inheritance. It should start off with the base classes
Account: contains the string name, int accountnumber, double balance.
Savings: Derived from Account class, it should contain double interest rate.
Checkings: Derived from Account class, it should contain double overdraftlimit.
CreditCard: Derived from Checkings class, it should contain int cardnumber.
Create a program which will create an array of 3 Savings accounts, 3 Checkings accounts and 3 CreditCards.
Create 3 files. Savings.txt, Checkings.txt, CreditCards.txt which contains the information for each and infile the information from the file to the array of the classes.
You will be graded on the method used to infile (make sure to use loops), the way the classes are constructed (inheritance), and the way the the classes are used (make sure the constructor and overloaded constructor is used correctly).
As for the Main, simply get all the data from the files in to the objects correctly and do a display of all 3 savings, checkings and creditcards in a neat fashion (iomanip).
Explanation / Answer
#include using namespace std; class Person { public: string profession; int age; Person(): profession("unemployed"), age(16) { } void display() { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.