C++ Polymorphism **Assignment Details In this assignment we are going to build a small banking system.Create a class cal

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

C++ Polymorphism **Assignment Details In this assignment we are going to build a small banking system.Create a class cal

Post by answerhappygod »

C++
Polymorphism **Assignment Details
In this assignment we are going to build a small banking
system.Create a class called Account which will be an abstract
class for three other classes called CheckingAccount,
SavingsAccount and BusinessAccount. Create get/set methods as
appropriate.Main Program Functionality
The main program will present a repeating menu with the following
options:
Create a new account
Creates a new account and stores it in a vector
Manage Accounts
Lists the person's name as a menu selection.
When person chooses a selection they get a sub menu to:
Deposit
Withdraw
Get Balance
List Transactions
Exit
Save accounts to file
Prompt the user for a file name.
Save the account information for all accounts entered, including
transactions
Be sure to:
Distinguish between account types
Distinguish between transaction types
Load account list from file
Prompt the user for a file name. Load the list of accounts and last
balances into memory including transactions.
Be sure to:
Distinguish between account types
Distinguish between transaction types
Account Class Breakdown
Base Class
Class: Checking Account
This is the abstract checking account base class. Actual instances
must be of a subclass.These data members must exist in the base
class, Checking account, for all account types.
Data members
Account Id - some identifier representing the account. It can be
whatever type you want
Customer Name - name of the customer
Balance - Current Balance
Transaction List - A list of historical transactions. This will
also be a hierarchy
Methods (Virtual)
Deposit(amount) - Deposits into an account with rules appropriate
to the account typeYou must prevent negative deposits.
Withdraw(amount) - Withdraws an ammount and reduces the balance on
that accountYou must validate the data to ensure it is
positive.
Get Balance - get the current balance
Print Summary - Print the customer id, name, balance and number of
transactionsPrint Statement - Print the customer id, namem balance
and number of transactions. - Print a list of all the transactions
including transaction type, date and amount
Child Classes
Savings Account
Additional Data Members
Interest rate - The annual interest rate
Deposit bonus - A small bonus paid per deposit based on certain
conditions
Withdrawal Penalty - A small penalty per withdrawel based on
certain conditions
Methods
Deposit(amount) - if the number of transactions on this account is
less than 5, add a bonus to the balance
Withdrawel (amount) - if the number of withdrawels exceeds 10,
charge a penalty against the balance
Print Summary
Print Statement.
Child Classes
Business Account
Additional Data Members
Transaction cost - Every transaction has a transaction cost,
whether depositing or withdrawing
Business Name
Methods
Constructor taking transaction fee as a parameter
Deposit(amount) - Deposit to account, apply transaction fee
Withdrawel (amount) - Withdraw From account, apply transaction
fee
Print Summary
Print Statement.
Transaction Class Breakdown
Base Class
Class: Transaction
This represents the minimum for a transaction. Certain transaction
types must have more information. Note that you do NOT ever need a
transaction type, as that's what subclasses are for.Data
members
Transaction date - Date of transaction
Transaction amount - Transaction amount. May be positive or
negative based on the transaction
Balance Snap shot - Balance AFTER this transaction.
Methods
Print - Prints out the transaction type, date, amount and new
balance
Child Classes
Class: Savings Account
Data Members
No new data membersMethods
Print - Prints out the transaction type, date, amount and new
balance
Class: Business Account
Data Members
No new data membersMethods
Print - Prints out the transaction type, date, amount and new
balance
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply