COMP 220 All Assignments COMP 220 All Assignments | Page 13
earned since the last transaction or balance inquiry. It should contain a function member to
return the number of days since the last transaction or balance inquiry.
STEP 4: Test Program Operation
All data-input and data-display operations (cin and cout) should be done in the function main()
test program. The test program should create one checking account and one savings account
with initial balances of $100 each using the functions defined in the class definitions. The test
program should also assign a unique, five-digit account
number to each account and assign an annual interest rate of 3% for the savings account. The
test program should then display a menu that allows the user to select
which option is to be performed on which account, including the following. Make a deposit and
specify the amount to a selected or an entered account. Make a with
drawal and specify the amount to a selected or an entered account. Return the balance of a
selected or an entered account. For deposit transactions, withdrawal
transactions, and balance inquiries, the updated balance and any fees charged or interest
earned should also be displayed. For the savings account, the number of days
since last transaction should be displayed. Exit the program. Each account operation should
display the account number and the account type.
Lab Questions
Please answer all the lab questions in the text file that is to be turned into the Dropbox. You are
not required to copy the question text into your document, but all answers
should be listed with the question number they answer.
Were any base-class functions called or overloaded in either of the derived classes? If so, list
which class and which function, and explain why they were either called or overloaded. Were
any derived-class functions not explicitly called by the test program? If so, list which class and
function, and explain why this was done. Which access
attribute was used for each of the classes derived from the base class? Why was this access
attribute chosen?