main()
{
float cr,dr;
float Bank = 3500.00
char ch,q;
int input;
char again;
do
{
cout<<" Enter amount to credit or debit the bank ";
cout<<" Enter an option 1 or 2 " <<endl;
cout<<endl;
cin>>input;
switch(input)
{
case 1:{
cout<<endl;
cout<<" Enter amount to credit the Bank."<<endl;
cin>> cr;
Bank += cr;
cout<<" Bank is now "<< Bank <<endl;
cr = 0;
break;}
case 2:{
cout<<" Enter amount to debit the Bank. "<<endl;
cin>> dr;
Bank -= dr;
dr = 0;
break;}
cout<< " Bank is now " << Bank <<endl;
cout<< " Would you like to restart( y or n)";
cin>> again;
while(again == 'y' || again == 'Y')
{
cout<<"Your ending balance is:" << Bank <<endl;
}
}
}
return 0;
}
Thank you vlad for your reply to my problem.
Would it be possible for you to show me a better way
to write this program. Again thanks vlad.
The prog.compiles ok but gives me errors.
expected 'while' before numeric constant
expected ')' before numeric constant
expected '(' before numeric token.
Thank you again vlad for your reply it somehow made me
go back to what has always been me problem (the placement of braces)
and I was able to fix the prog. now it runs ok.
Many thanks.