SlideShare ist ein Scribd-Unternehmen logo
1 von 4
TO Buy the Tutorial Visit Our Website

This lab introduces you to writing a C++ program to implement the concept of
class inheritance using different types of bank accounts as a model. In this lab,
you will create a base class, called CBankAccount, and two additional classes
(each derived from CBankAccount), called CSavingsAccount and
CCheckingAccount. You will then test the operations of each class in function
main() to simulate the transactions of both a checking account and a savings
account.
Deliverables
Submit a single Notepad file containing the source code for all the files of the
lab to the Dropbox for Week 3. Your source code should use proper indentation
and be error free. Be sure that your last name and the lab number are part of the
file name: for example, YourLastName_Lab3.txt.
Each program should include a comment section that includes (minimally) your
name, the lab and exercise number, and a description of what the program
accomplishes. Submit a lab report (a Word document) containing the following
information to the Dropbox for Week 3. Include your name and the lab or labexercise number. Specification: Include a brief description of what the program
accomplishes, including its input, key processes, and output. Test Plan: Include
a brief description of the method you used to confirm that your program worked
properly. If necessary, include a clearly labeled table with test cases, predicted
results, and actual results. Summary and Conclusions: Includea summary of
what the lab demonstrated and any conclusions drawn from the testing of the
lab program. Provide a UML diagram showing the base and the derived class
relationships, access specifiers, data types, and function arguments. Answers to
Lab Questions: Answer any and all of the lab questions included in the lab
steps.
Summary: Write a statement summarizing your predicted and actual output.
Identify and explain any differences.
Conclusions: Write at least one nontrivial paragraph that explains, in detail,
either a significant problem you had and how you solved it or, if you had no
significant problems, something you learned by doing the exercise.
Each lab exercise should have a separate section in the lab-report document.
Your lab grade is based upon
the formatting of your source code; the use of meaningful identifiers; the extent
of internal documentation; the degree to which an exercises’ specifications are
met; and the completeness of your lab report.
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.
It should contain data members to store a bank customer's balance and account
number. These should be of different and appropriate data types. It should have
function members that do the following: set the account number; return the
account number; return the account balance; deposit money into the account;
and 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.
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. Override the base class, withdraw-money function, and
add the capability to deduct transaction fees from an account using the
following guidelines. 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. If there
are insufficient funds in the account balance to cover the withdrawal plus the
service fee, the withdrawal should be denied. 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.
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. 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 randomnumber 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. It should contain a data member to hold the interest
earned since the last transaction or balance inquiry. It should contain a function
member to set the annual interest rate. Utilize the base-class functions for both
withdrawal and deposit operations for the savings account. Override the baseclass-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. 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. A value should be returned to indicate whether a
withdrawal transaction succeeded or failed. It should contain a function member
to return the interest 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 withdrawal 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?

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (6)

Finlandia
FinlandiaFinlandia
Finlandia
 
Al zafar ul mubeen
Al zafar ul mubeenAl zafar ul mubeen
Al zafar ul mubeen
 
Tareekh ibne khaldoon 5
Tareekh ibne khaldoon 5Tareekh ibne khaldoon 5
Tareekh ibne khaldoon 5
 
Silence khamoshee
Silence khamosheeSilence khamoshee
Silence khamoshee
 
European alternatives elena dalibot
European alternatives   elena dalibotEuropean alternatives   elena dalibot
European alternatives elena dalibot
 
Mor çatı kadın sığınağı vakfı zelal yalçın
Mor çatı kadın sığınağı vakfı   zelal yalçınMor çatı kadın sığınağı vakfı   zelal yalçın
Mor çatı kadın sığınağı vakfı zelal yalçın
 

Ähnlich wie Comp 220 i lab 3 bank account lab report and source code

Rinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat PortfolioRinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat PortfolioRinkeshkumar15
 
Rinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat PortfolioRinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat PortfolioRinkeshkumar15
 
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docxStudent Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docxemelyvalg9
 
Counting -cycle_count_using_mobile_application
Counting  -cycle_count_using_mobile_applicationCounting  -cycle_count_using_mobile_application
Counting -cycle_count_using_mobile_applicationmanitenkasi
 
Prg 420 entire course
Prg 420 entire coursePrg 420 entire course
Prg 420 entire coursePRG420
 
Administrative InformationDate AssignedSaturday, March 30, 2.docx
Administrative InformationDate AssignedSaturday, March 30, 2.docxAdministrative InformationDate AssignedSaturday, March 30, 2.docx
Administrative InformationDate AssignedSaturday, March 30, 2.docxcoubroughcosta
 
Article Reviews each class will typically offer at least one arti.docx
Article Reviews each class will typically offer at least one arti.docxArticle Reviews each class will typically offer at least one arti.docx
Article Reviews each class will typically offer at least one arti.docxfredharris32
 
Microsoft az-204 download free demo at dumps cafe
Microsoft az-204 download free demo at dumps cafeMicrosoft az-204 download free demo at dumps cafe
Microsoft az-204 download free demo at dumps cafeJeannieHeldt
 
Itco 620 unit 5 project
Itco 620 unit 5 projectItco 620 unit 5 project
Itco 620 unit 5 projectcomp274
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfmallik3000
 
Prg 420-entire-course
Prg 420-entire-coursePrg 420-entire-course
Prg 420-entire-courseDR Dean Jame
 
Congratulations!! You have been selected to create a banking simulat.docx
Congratulations!! You have been selected to create a banking simulat.docxCongratulations!! You have been selected to create a banking simulat.docx
Congratulations!! You have been selected to create a banking simulat.docxbreaksdayle
 
Prg 420 week 3 assignments
Prg 420 week 3 assignmentsPrg 420 week 3 assignments
Prg 420 week 3 assignmentsPRG420
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchartfika sweety
 

Ähnlich wie Comp 220 i lab 3 bank account lab report and source code (16)

Rinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat PortfolioRinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat Portfolio
 
Rinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat PortfolioRinkeshkumar Bhagat Portfolio
Rinkeshkumar Bhagat Portfolio
 
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docxStudent Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
 
Counting -cycle_count_using_mobile_application
Counting  -cycle_count_using_mobile_applicationCounting  -cycle_count_using_mobile_application
Counting -cycle_count_using_mobile_application
 
Prg 420 entire course
Prg 420 entire coursePrg 420 entire course
Prg 420 entire course
 
Administrative InformationDate AssignedSaturday, March 30, 2.docx
Administrative InformationDate AssignedSaturday, March 30, 2.docxAdministrative InformationDate AssignedSaturday, March 30, 2.docx
Administrative InformationDate AssignedSaturday, March 30, 2.docx
 
Article Reviews each class will typically offer at least one arti.docx
Article Reviews each class will typically offer at least one arti.docxArticle Reviews each class will typically offer at least one arti.docx
Article Reviews each class will typically offer at least one arti.docx
 
Summary Account R12 General Ledger
Summary Account R12 General LedgerSummary Account R12 General Ledger
Summary Account R12 General Ledger
 
Microsoft az-204 download free demo at dumps cafe
Microsoft az-204 download free demo at dumps cafeMicrosoft az-204 download free demo at dumps cafe
Microsoft az-204 download free demo at dumps cafe
 
Itco 620 unit 5 project
Itco 620 unit 5 projectItco 620 unit 5 project
Itco 620 unit 5 project
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdf
 
Prg 420-entire-course
Prg 420-entire-coursePrg 420-entire-course
Prg 420-entire-course
 
Congratulations!! You have been selected to create a banking simulat.docx
Congratulations!! You have been selected to create a banking simulat.docxCongratulations!! You have been selected to create a banking simulat.docx
Congratulations!! You have been selected to create a banking simulat.docx
 
Defining The System
Defining The SystemDefining The System
Defining The System
 
Prg 420 week 3 assignments
Prg 420 week 3 assignmentsPrg 420 week 3 assignments
Prg 420 week 3 assignments
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 

Kürzlich hochgeladen

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 

Kürzlich hochgeladen (20)

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 

Comp 220 i lab 3 bank account lab report and source code

  • 1. TO Buy the Tutorial Visit Our Website This lab introduces you to writing a C++ program to implement the concept of class inheritance using different types of bank accounts as a model. In this lab, you will create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount. You will then test the operations of each class in function main() to simulate the transactions of both a checking account and a savings account. Deliverables Submit a single Notepad file containing the source code for all the files of the lab to the Dropbox for Week 3. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab3.txt. Each program should include a comment section that includes (minimally) your name, the lab and exercise number, and a description of what the program accomplishes. Submit a lab report (a Word document) containing the following information to the Dropbox for Week 3. Include your name and the lab or labexercise number. Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output. Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results. Summary and Conclusions: Includea summary of what the lab demonstrated and any conclusions drawn from the testing of the
  • 2. lab program. Provide a UML diagram showing the base and the derived class relationships, access specifiers, data types, and function arguments. Answers to Lab Questions: Answer any and all of the lab questions included in the lab steps. Summary: Write a statement summarizing your predicted and actual output. Identify and explain any differences. Conclusions: Write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise. Each lab exercise should have a separate section in the lab-report document. Your lab grade is based upon the formatting of your source code; the use of meaningful identifiers; the extent of internal documentation; the degree to which an exercises’ specifications are met; and the completeness of your lab report. 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. It should contain data members to store a bank customer's balance and account number. These should be of different and appropriate data types. It should have function members that do the following: set the account number; return the account number; return the account balance; deposit money into the account; and 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.
  • 3. 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. Override the base class, withdraw-money function, and add the capability to deduct transaction fees from an account using the following guidelines. 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. If there are insufficient funds in the account balance to cover the withdrawal plus the service fee, the withdrawal should be denied. 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. 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. 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 randomnumber 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. It should contain a data member to hold the interest earned since the last transaction or balance inquiry. It should contain a function member to set the annual interest rate. Utilize the base-class functions for both withdrawal and deposit operations for the savings account. Override the baseclass-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. 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. A value should be returned to indicate whether a
  • 4. withdrawal transaction succeeded or failed. It should contain a function member to return the interest 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 withdrawal 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?