Download: Bank Account iLab C++

Published on June 2016 | Categories: Types, School Work | Downloads: 77 | Comments: 0 | Views: 193
of 3
Download PDF   Embed   Report

Download: http://solutionzip.com/downloads/bank-account-ilab-c/i L A B S T E P SSTEP 1: Create the Multifile Project and the Main (Base) ClassCreate a new project that consists of the base class BankAccount.The BankAccount class should contain, at minimum, the following members.1. It should contain data members to store a bank customer’s balance and account number. These should be of different and appropriate data types.2. It should have function members that do the following:a. set the account number;b. return the account number;c. return the account balance;d. deposit money into the account; ande. withdraw money from the account.STEP 2: Create the CheckingAccount Class Derived From the BankAccount ClassThe class CheckingAccount should contain, at a minimum, the following members.1. It should contain a data member to keep track of the number of withdrawal transactions made on the account. Whenever a withdrawal is made, this number should be incremented.2. Override the base class, withdraw-money function, and add the capability to deduct transaction fees from an account using the following guidelines.a. The checking account is allowed three free transactions. For each successful withdrawal transaction past the three free transactions, there will be a service fee of 50 cents per transaction. The service fee should be deducted from the account balance at the time the transaction is made.b. If there are insufficient funds in the account balance to cover the withdrawal plus the service fee, the withdrawal should be denied.c. The function should return a value to indicate whether the transaction succeeded or failed. Transaction fees should be deducted only from successful transactions, but the transaction count should be incremented in either case.STEP 3: Create the SavingsingAccount Class Derived From the BankAccount ClassThe class CheckingAccount should contain, at a minimum, the following members.1. It should contain a data member to hold the daily interest rate. The daily interest rate can be calculated from a yearly interest rate by dividing the annual rate by 365.2. It should contain a data member to keep track of the number of days since the last transaction or balance inquiry. This should be updated using a random-number generator (reference Lab 1) that will return a value representing the number of days between 0 and 7, inclusive. We will assume that this bank is open every day of the year.3. It should contain a data member to hold the interest earned since the last transaction or balance inquiry.4. It should contain a function member to set the annual interest rate.5. Utilize the base-class functions for both withdrawal and deposit operations for the savings account.6. Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made.7. If there are insufficient funds in the account balance to cover a withdrawal, the withdrawal should be denied. The number of days since the last transaction or balance inquiry and the interest calculations should still be made.8. A value should be returned to indicate whether a withdrawal transaction succeeded or failed.9. It should contain a function member to return the interest earned since the last transaction or balance inquiry.10. It should contain a function member to return the number of days since the last transaction or balance inquiry.STEP 4: Test Program Operation1. All data-input and data-display operations (cin and cout) should be done in the function main() test program.2. The test program should create one checking account and one savings account with initial balances of $100 each using the functions defined

Comments

Content

Download:

http://solutionzip.com/downloads/bank-account-ilab-c/

iLABSTEPS STEP 1: Create the Multifile Project and the Main (Base) Class Create a new project that consists of the base class BankAccount. The BankAccount class should contain, at minimum, the following members. 1. It should contain data members to store a bank customer’s balance and account number. These should be of different and appropriate data types. 2. It should have function members that do the following: a. set the account number; b. return the account number; c. return the account balance; d. deposit money into the account; and e. withdraw money from the account. STEP 2: Create the CheckingAccount Class Derived From the BankAccount Class The class CheckingAccount should contain, at a minimum, the following members. 1. It should contain a data member to keep track of the number of withdrawal transactions made on the account. Whenever a withdrawal is made, this number should be incremented. 2. Override the base class, withdraw-money function, and add the capability to deduct transaction fees from an account using the following guidelines. a. The checking account is allowed three free transactions. For each successful withdrawal transaction past the three free transactions, there will be a service fee of 50 cents per transaction. The service fee should be deducted from the account balance at the time the transaction is made. b. If there are insufficient funds in the account balance to cover the withdrawal plus the service fee, the

withdrawal should be denied. c. The function should return a value to indicate whether the transaction succeeded or failed. Transaction fees should be deducted only from successful transactions, but the transaction count should be incremented in either case. STEP 3: Create the SavingsingAccount Class Derived From the BankAccount Class The class CheckingAccount should contain, at a minimum, the following members. 1. It should contain a data member to hold the daily interest rate. The daily interest rate can be calculated from a yearly interest rate by dividing the annual rate by 365. 2. It should contain a data member to keep track of the number of days since the last transaction or balance inquiry. This should be updated using a random-number generator (reference Lab 1) that will return a value representing the number of days between 0 and 7, inclusive. We will assume that this bank is open every day of the year. 3. It should contain a data member to hold the interest earned since the last transaction or balance inquiry. 4. It should contain a function member to set the annual interest rate. 5. Utilize the base-class functions for both withdrawal and deposit operations for the savings account. 6. Override the base-class-balance inquiry function to add calculating and adding interest to the account based on the daily interest rate, the current balance of the account, and the number of days since the last balance inquiry. This should be called only when a balance inquiry is made, not when a deposit or withdrawal transaction or an account number inquiry is made. 7. If there are insufficient funds in the account balance to cover a withdrawal, the withdrawal should be denied. The number of days since the last transaction or balance inquiry and the interest calculations should still be made. 8. A value should be returned to indicate whether a withdrawal transaction succeeded or failed. 9. It should contain a function member to return the interest earned since the last transaction or balance inquiry. 10. It should contain a function member to return the number of days since the last transaction or balance inquiry. STEP 4: Test Program Operation 1. All data-input and data-display operations (cin and cout) should be done in the function main() test program. 2. 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. 3. 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. a. Make a deposit and specify the amount to a selected or an entered account. b. Make a withdrawal and specify the amount to a selected or an entered account. c. Return the balance of a selected or an entered account. i. For deposit transactions, withdrawal transactions, and balance inquiries, the updated balance and any fees charged or interest earned should also be displayed. ii. For the savings account, the number of days since last transaction should be displayed. d. Exit the program.

4. 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. 1. 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. 2. 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. 3. Which access attribute was used for each of the classes derived from the base class? Why was this access attribute chosen?

Download:

http://solutionzip.com/downloads/bank-account-ilab-c/

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close