Learning Goal: I’m working on a programming exercise and need an explanation and answerto help me learn.
ASSIGNMENT
Please pay careful attention to all assignment requirements. You are graded on your ability to
implement each requirement. (In review of week 1 submissions, many students overlooked a
simple requirement to implement a static member variable.)
Regarding week 1. You will be creating a BankAccount class and test program. This will consists
of three files:
testBankAccount.cpp
bankAccount.h
bankAccount.cpp
.
Advanced Programming in C++ – W1 Assignment
Classes
bankAccount Class
Define the class bankAccount to implement the basic properties of a bank account. The class
should store and implement the following data / methods:
bankAccount
Data
•
•
•
•
•
•
Methods
deposit (add money to account)
Account holders name (string)
withdraw (take money out of
Account number (int)
Account type (string, checking or savings)
account)
Balance (double)
Interest rate (double, to be stored as a decimal value) getInterest (balance times interest
Static member (int named anything) used to
rate)
automatically assign account numbers during
updateBalance (adds interest
account creation.
amount to balance)
print (displays all account
information)
getAccountNumber
getAccountHolderName
getAccountType
getBalance
getInterestRate
Constructor:
•
•
•
•
•
sets account holders name
sets account type
sets balance
sets interest rate
(account number is auto generated in constructor)
Create a main program to test the class as follows:
•
•
•
Declare an array of 10 components of type bankAccount.
Prompt the user or hard code information for up to 10 customers. For each customer,
assign name, account type, balance, and interest rate.
After all information is entered, print all account information for each customer.
Implementation Requirements
Directions
You are to write a C++ program that meets the instruction requirements above. Use the
assignment template to insert the assignment deliverables outlined above.