You are supposed to implement a C++ program that mimics some of the processes in
ID: 3779142 • Letter: Y
Question
You are supposed to implement a C++ program that mimics some of the processes in a bank. The customers are lined up in a queue and wait their turn in order to perform the following actions: withdraw money, deposit money, lend their money at interest (you can assign a default value), etc. These operations should be processed through a menu. Therefore, we should be able to choose the operations and enter the data which will be processed by the rest of your code. An example can be seen below: Withdraw Money Deposit Money Lend Money at Interest ... At the end of each operation, each customer will receive a bill showing the list of their activities. This list should include the most recent activity at the top and the least recent activity at the bottom. In order to perform this operation, you will use a stack which will reverse the activities from latest to the oldest. An example can be seen below: Customer Name: ABCDE Customer Surname: ABCDE Customer ID: 123456 Account Movements/Statements: 14.15 - the customer withdraws 15 dollars from account 14.00 - the customer lends money at interest 13.55 - the customer deposits 50 dollars into accountExplanation / Answer
#include<conio.h>
#include<stdio.h>
class account
{
int Lend_Money_at_Interest, Deposit_Money, withdraw_Money;
char Customer_name[50];
char Customer_Surname;
int Customer_ID;
char Accout_Statements[100];
public:
void operation()
{
cout<<" ====Operations==== ";
cout<<" Enter Customer Name : ";
gets(Customer_name);
cout<<" Enter Customer Sirname: ";
gets(custome_sirname);
cout<<" Enter Customer ID : ";
cin>>customer_ID;
type=toupper(type)
cout<<" Enter Initial amount >=500 for Saving >=1000 for current :";
cin>>Deposit_Money;
cout<<" Your Account Created Successfully ..";
}
void account_info()
{
cout<<" ----ACCOUNT STATUS---- ";
cout<<" Customer Name : "<<customer_name;
cout<<" Customer Sirname : "<<customer_sirname;
cout<<" Customer_ID : "<<customer_ID;
cout<<" Accout Statements : "<<Deposite_Money;
}
void deposite(int x)
{
deposit+=x;
}
void draw(int x)
{
deposit-=x;
}
void report()
{
cout<<acno<<" "<<name<<" "<<type<<" "<<deposit<<endl;
}
int acc_rec()
{
return acno;
}
float retdeposit()
{
return deposit;
}
char rettype()
{
return type;
}
}
void display_sp()
{
int acc;
cout<<" ====BALANCE DETAILS====";
cout<<" Enter the Account Number : ";
cin>>acc;
int flag=0;
fp.open("account.dat",ios::in);
while(fp.read((char*)&ac,sizeof(account)))
{
if(acc.accrec()==n)
{
ac.show_account();
flag=1;
}
}
fp.close();
if(flag==0)
cout<<" Account Number does not exist";
getch();
}
void display_all()
{
fp.open("account.dat",ios::in);
if(!fp)
{
cout<<"ERROR!!! FILE COULD NOT BE OPEN ";
getch();
return;
}
cout<<" ACCOUNT HOLDER LIST ";
cout<<"==================================================== ";
cout<<"A/c no. Custer Name Customer Sirname Customer ID Account Statements ";
cout<<"==================================================== ";
while(fp.read((char*)&ac,sizeof(account)))
{
ac.report();
}
fp.close();
getch();
}
void main()
{
char ch;
intro();
do
{
clrscr();
cout<<" MAIN MENU";
cout<<" 01. NEW ACCOUNT";
cout<<" 02. DEPOSIT AMOUNT";
cout<<" 03. WITHDRAW AMOUNT";
cout<<" 04. BALANCE ENQUIRY";
cout<<" 05. ALL ACCOUNT HOLDER LIST";
cout<<" 06. CLOSE AN ACCOUNT";
cout<<" 07. MODIFY AN ACCOUNT";
cout<<" 08. EXIT";
cout<<" Select Your Option (1-8) ";
ch=getche();
clrscr();
switch(ch)
{
case '1': Deposit_Money(1);
break;
case '2': Withdraw_Money(2);
break;
case '3': Display_info();
break;
case '4': exit(0);
default : cout<<"";
}
}while(ch!='4');
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.