#include <iostream>
#include <cmath>
usingnamespace std;
char choose(char z)
{
cout<<"Please enter your choice:" <<endl<<"(D)eposit"<<endl<<"(W)ithdrawl"<<endl<<"(B)alance"<<endl<<"Q(uit)";
cin>> z;
if(z=='D'){
int menus(int depo);
int dep;
cout<<"deposit"<<endl<<"How much would you like to deposit?";
cin>>dep;
double balan=dep+balan;
return balan;
}
if(z=='W'){
int withdraw;
int x;
int bal;
cout<<"withdrawl"<<endl<< "How much would you like to withdrawl?";
cin>>x;
double newbal=bal-x;
return newbal;
}
if(z=='B'){
int display (int bal);
cout<<"Your balance is: "<<"\n";
return z;
}
if(z=='Q'){
cout<<"quit";
return 0;
if (z!='D'||z!='W'||z!='B'||z!='Q'){
cout<<"Invalid Selection."<<endl<<"Please choose again.";
}
}
}
int main(){
char menu;
double bal=0;
char choice;
do {
choice= menu(); //call the function to display the menu & return the user's choice
switch(choice) {
case'D': bal = deposit (bal); break;
case'W': bal = withdrawl (bal); break;
case'B': display (bal); break;
}
}
while (choice !='Q');
cout <<"\nThank you!\n Come Again!";
}