C++ programming Long question, answer to it very much appreciated. Please answer
ID: 3830018 • Letter: C
Question
C++ programming
Long question, answer to it very much appreciated. Please answer all parts thank you :)
Create all of the following classes and create definitions for all the necessary functions from classes in following figure below; other neccesary requirements below aswell.
please create all classes and definitions for all functions.
Make the bankAccount class and checkingAccount class to be abstract class
The function to create monthly statements in bankAccount class should be pure virtual function
The function to write checks in checkingAccount class should be pure virtual function
Set the default interest rate for highInterestChecking, highInterestSaving and CD to be 5%, the default interest rate for savingsAccount to be 3%, and the default interest rate for noServiceChargeChecking to be 2%
Set the default minimum balance for highInterestChecking to be $5000, the default minimum balance of highInterestSaving to be $2500, and the default minimum balance for noServiceChargeChecking to be $1000
Set the monthly service charge for the serviceChargeChecking to be $10, set the monthly maximum number of checks allowed for serviceChargeChecking to be 5, and set the service charge when the number of checks exceed the maximum number of checks allowed to be $5
All classes and What should be included in each class:
bank account class: Every bank account has an account number, the name of the owner, and a balance. Therefore, instance variables such as name , accountNumber , and balance should be declared in the abstract class bankAccount . Some operations common to all types of accounts are retrieveaccount owner’s name, account number, and account balance; make deposits;withdraw money; and create monthly statements. So include functions toimplement these operations. Some of these functions will be pure virtual.
checking account class: A checking account is a bank account. Therefore, itinherits all the properties of a bank account. Because one of the objectives of a checking account is to be able to write checks, include the pure virtualfunction writeCheck to write a check.
serviceChargeChecking class: A service charge checking account is a checkingaccount. Therefore, it inherits all the properties of a checking account. For simplicity, assume that this type of account does not pay any interest, allows theaccount holder to write a limited number of checks each month, and does notrequire any minimum balance. Include appropriate named constants, instancevariables, and functions in this class.
noServiceChargeChecking class: A checking account with no monthly servicecharge is a checking account. Therefore, it inherits all the properties of achecking account. Furthermore, this type of account pays interest, allows theaccount holder to write checks, and requires a minimum balance
highInterestChecking class : A checking account with high interest is a checkingaccount with no monthly service charge. Therefore, it inherits all the properties of a no service charge checking account. Furthermore, this type of account payshigher interest and requires a higher minimum balance than the no servicecharge checking account.
savings account class: A savings account is a bank account. Therefore, it inheritsall the properties of a bank account. Furthermore, a savings account also paysinterest.
highInterestSavings class: A high-interest savings account is a savings account.Therefore, it inherits all the properties of a savings account. It also requires aminimum balance.
certificateOfDeposit class :A certificate of deposit account is a bank account.Therefore, it inherits all the properties of a bank account. In addition, it hasinstance variables to store the number of CD maturity months, interest rate, andthe current CD month.
:E I search or enter page a C++ Programming 898 I Chapter 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists checkingaccount ertificateofDepo savings Account hich Interestsavings servicecharge hecking Chan Checking tch FIGURE 2-25 inheritance hierarchy of banking accounts Note that the classes bankaccount and checkingAccount are abstract. Thar is, we cannot instantiate obyects of these classes. The other classes in Figure 12-25 are not abstract. bank account has a bankAccount: Every number. the name the owner, and a balance. Therefore, installe variables sucl as name. accountNumber, and balance should be declared in the abstract class bankAccount. Some operations common to all types of accounts are retrieve account owner's name, account number, and account balance; make deposits; withdraw money; and create monthly statements. So include functions to implement these operations. Some ofrhese finnctions will he pure virnal. checkingAccount: A checking accoun is a bank account. Therefore, it inherits all the properties of a bank account. Because one of the objectives of a checking account is to be able to write checks. include the pure virul function writeCheck to write a check erwiaechargerChealkina. AA MareExplanation / Answer
# include<iostream.h>
# include<conio.h>
# include<iomanip.h>
class bank
{
char name[20];
int acno;
char actype[4];
float balance;
public:
void init();
void deposit();
void withdraw();
void disp_det();
};
//member functions of bank class
void bank :: init()
{
cout<<"
New Account
";
cout<<"
Enter the Name of the depositor : ";
cin.get(name,19,'
');
cout<<"
Enter the Account Number : ";
cin>>acno;
cout<<"
Enter the Account Type : (CURR/SAVG/FD/RD/DMAT) ";
cin>>actype;
cout<<"
Enter the Amount to Deposit : ";
cin >>balance;
}
void bank :: deposit()
{
float more;
cout <<"
Depositing
";
cout<<"
Enter the amount to deposit : ";
cin>>more;
balance+=more;
}
void bank :: withdraw()
{
float amt;
cout<<"
Withdrwal
";
cout<<"
Enter the amount to withdraw : ";
cin>>amt;
balance-=amt;
}
void bank :: disp_det()
{
cout<<"
Account Details
";
cout<<"Name of the depositor : "<<name<<endl;
cout<<"Account Number : "<<acno<<endl;
cout<<"Account Type : "<<actype<<endl;
cout<<"Balance : $"<<balance<<endl;
}
// main function , exectution starts here
void main(void)
{
clrscr();
bank obj;
int choice =1;
while (choice != 0 )
{
cout<<"
Enter 0 to exit
1. Initialize a new acc.
2. Deposit
3.Withdraw
4.See A/c Status";
cin>>choice;
switch(choice)
{
case 0 :obj.disp_det();
cout<<"
EXITING PROGRAM.";
break;
case 1 : obj.init();
break;
case 2: obj.deposit();
break;
case 3 : obj.withdraw();
break;
case 4: obj.disp_det();
break;
default: cout<<"
Illegal Option"<<endl;
}
}
getch();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.