Help Create a C Application that Functional Requirements Sav
Help: Create a C++ Application that: Functional Requirements: Save-More is a small community bank that offers its customers 3 types of Bank Accounts – an interest bearing savings account, a checking account and a certificate of deposit. All Bank accounts have an Account Number, an Interest rate and a Balance – and have the ability to withdraw funds, deposit funds and display the account’s attributes. The Savings account has a variable interest rate. Balances under $10,000 earn 1% APR interest and balances >= $10,000 earn 2% APR. The rate is updated dynamically if and when the balance changes. Interest is compounded monthly and added to the balance. All savings withdrawals are charged a fee of $2, deducted from the balance at the time of withdrawal. The Checking Account is non-interest bearing. If the checking account balance drops below $500 a fee of $5.00 is deducted from the balance. Checking accounts have the capability to order checks for $15, deducted directly from the balance. The Certificate of Deposit (CD) earns 10% with a 5 year term and 5% for anything less. The term is set on account creation and cannot be updated. Interest is compounded monthly and added to the balance. If funds are withdrawn before the term is over, a 10% fee on the entire pre-withdrawal balance is levied Regardless of the type of account, customers are never allowed to go negative with a withdrawal. Program Requirements: Design and implement a set of classes in C++ to support all of the above functional requirements. Define class member data, constructors and member functions as required to fulfill on the requirements. The class structures defined should demonstrate inheritance implementing Savings, Checking and CD accounts as derived classes of the base class Bank Account. Deposit and withdrawal methods should return a value to indicate success or failure of the method (0=success -1=failure) If an operation will make an account go negative, the operation should not be completed and a failure returned from the method The classes created should be exercised/tested by leveraging your main() function and performing the following operations (in order): - Create a new savings account and deposit $10k - Create a new checking account and deposit $600 - Create a new CD account with a 3 year term and deposit $10K - Get and display the attributes for each account - Calculate monthly interest for the savings account - Calculate the monthly interest for the CD account - Get and display the attributes for each account - Order checks - Withdraw $200 from checking - Withdraw $1000 from Savings - Perform an early withdrawal of $2000 from the CD account - Get and display the account attributes for each account Polymorphism must be demonstrated with the creation of the bank accounts Thank you!
Solution
#include <iostream.h>
#include <conio.h>
class account
{
char cust_name[20];
int acc_no;
char acc_type[20];
public:
void get_accinfo()
{
cout<<\"\ \ Enter Customer Name :- \";
cin>>cust_name;
cout<<\"Enter Account Number :- \";
cin>>acc_no;
cout<<\"Enter Account Type :- \";
cin>>acc_type;
}
void display_accinfo()
{
cout<<\"\ \ Customer Name :- \"<<cust_name;
cout<<\"\ Account Number :- \"<<acc_no;
cout<<\"\ Account Type :- \"<<acc_type;
}
};
class cur_acct : public account
{
staticfloat balance;
public:
void disp_currbal()
{
cout<<\"\ Balance :- \"<<balance;
}
void deposit_currbal()
{
float deposit;
cout<<\"\ Enter amount to Deposit :- \";
cin>>deposit;
balance = balance + deposit;
}
void withdraw_currbal()
{
float penalty,withdraw;
cout<<\"\ \ Balance :- \"<<balance;
cout<<\"\ Enter amount to be withdraw :-\";
cin>>withdraw;
balance=balance-withdraw;
if(balance < 500)
{
penalty=(500-balance)/10;
balance=balance-penalty;
cout<<\"\ Balance after deducting penalty : \"<<balance;
}
elseif(withdraw > balance)
{
cout<<\"\ \ You have to take permission for Bank Overdraft Facility\ \";
balance=balance+withdraw;
}
else
cout<<\"\ After Withdrawl your Balance revels : \"<<balance;
}
};
class sav_acct : public account
{
staticfloat savbal;
public:
void disp_savbal()
{
cout<<\"\ Balance :- \"<<savbal;
}
void deposit_savbal()
{
float deposit,interest;
cout<<\"\ Enter amount to Deposit :- \";
cin>>deposit;
savbal = savbal + deposit;
interest=(savbal*2)/100;
savbal=savbal+interest;
}
void withdraw_savbal()
{
float withdraw;
cout<<\"\ Balance :- \"<<savbal;
cout<<\"\ Enter amount to be withdraw :-\";
cin>>withdraw;
savbal=savbal-withdraw;
if(withdraw > savbal)
{
cout<<\"\ \ You have to take permission for Bank Overdraft Facility\ \";
savbal=savbal+withdraw;
}
else
cout<<\"\ After Withdrawl your Balance revels : \"<<savbal;
}
};
float cur_acct :: balance;
float sav_acct :: savbal;
void main()
{
clrscr();
cur_acct c1;
sav_acct s1;
cout<<\"\ Enter S for saving customer and C for current a/c customer\ \ \";
char type;
cin>>type;
int choice;
if(type==\'s\' || type==\'S\')
{
s1.get_accinfo();
while(1)
{
clrscr();
cout<<\"\ Choose Your Choice\ \";
cout<<\"1) Deposit\ \";
cout<<\"2) Withdraw\ \";
cout<<\"3) Display Balance\ \";
cout<<\"4) Display with full Details\ \";
cout<<\"5) Exit\ \";
cout<<\"6) Choose Your choice:-\";
cin>>choice;
switch(choice)
{
case 1 : s1.deposit_savbal();
getch();
break;
case 2 : s1.withdraw_savbal();
getch();
break;
case 3 : s1.disp_savbal();
getch();
break;
case 4 : s1.display_accinfo();
s1.disp_savbal();
getch();
break;
case 5 : goto end;
default: cout<<\"\ \ Entered choice is invalid,\\\"TRY AGAIN\\\"\";
}
}
}
else
{
{
c1.get_accinfo();
while(1)
{
cout<<\"\ Choose Your Choice\ \";
cout<<\"1) Deposit\ \";
cout<<\"2) Withdraw\ \";
cout<<\"3) Display Balance\ \";
cout<<\"4) Display with full Details\ \";
cout<<\"5) Exit\ \";
cout<<\"6) Choose Your choice:-\";
cin>>choice;
switch(choice)
{
case 1 : c1.deposit_currbal();
getch();
break;
case 2 : c1.withdraw_currbal();
getch();
break;
case 3 : c1.disp_currbal();
getch();
break;
case 4 : c1.display_accinfo();
c1.disp_currbal();
getch();
break;
case 5 : goto end;
default: cout<<\"\ \ Entered choice is invalid,\\\"TRY AGAIN\\\"\";
}
}
}
end:
}
}



