Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in C++ and has 9 classes Account.cpp Account.h Checking.cpp Checking.h Savings.cpp Savings.h CreditCard.cpp CreditCard.h Main.cpp Here is the following set of classes you

This is in C++ and has 9 classes

Account.cpp

Account.h

Checking.cpp

Checking.h

Savings.cpp

Savings.h

CreditCard.cpp

CreditCard.h

Main.cpp

Here is the following set of classes you will implement and their inheritance relationship:

Account

The generic BASE class Account will serve as the parent class to Checking, Savings and CreditCard.

Variables (private):

name Name of account owner, a string

taxID social security number, a long

balance an amount in dollars, a double

Variables (protected):

last10withdraws a double array of size 10. The last 10 withdrawel amounts.

last10deposits a double array of size 10. The last 10 deposit amounts.

numdeposits number of deposits, an int

numwithdraws number of withdrawels, an int

Methods:

SetName, SetTaxID, Setbalance() assigns a new value for each with error checking

GetName, GetTaxID, Getbalance() returns a value for each variable.

MakeDeposit( double amount ) - adjust the balance and put it in the deposit array

A constructor with no parameters and one with name, taxID and balance parameters

display() a method to display the name, taxID and balance

Checking

A specific DERIVED class that represents a bank checking account. It must inherit Account.

Variables (private):

last10checks an int array of size 10. The last 10 check numbers.

Methods:

WriteCheck( int checknum, double amount ) - adjust the balance and list it as a withdraw in the base class

A constructor with no parameters and one with name, taxID and balance parameters

display() - display the accounts check register (number and amount) and deposit record

Savings

A specific DERIVED class that represents a bank savings account. It must inherit Account.

Methods:

DoWithdraw( double amount) - adjust the balance and list it as a withdraw in the base class

A constructor with no parameters and one with name, taxID and balance parameters

display() - display the accounts withdrawel and deposit record

CreditCard

A specific DERIVED class that represents a credit card account. It must inherit Account.

Variables:

cardnumber a long

last10charges a string array of size 10. The last 10 names of the charges.

Methods:

DoCharge( string name, double amount ) - adjust the balance and list it as a withdraw in the base class

MakePayment( double amount) - adjust the balance and list it as a DEPOSIT in the base class

A constructor with no parameters and one with name, taxID and balance parameters

display() - display the accounts charges ( name and amount ) and deposit record

Note: all display() methods should use cout to output text to the console.

Write a main() Function

Write a main that creates 3 objects, starts each with a balance of $100. Create a loop that displays the following menu each time through the loop. Make sure the balance is updated each time AND you use the objects to perform the transactions.

Checking balance: $100 Savings balance: $100 Credit Card balance: $100

1. Savings Deposit

2. Savings Withdrawel

3. Checking Deposit

4. Write A Check

5. Credit Card Payment

6. Make A Charge

7. Display Savings

8. Display Checking

9. Display Credit Card

0. Exit

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

Step: 3

blur-text-image

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

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions