Hey guys im working on a a banking program for my cpsc class and i have the code finished and i just cant get it to run, i believe my brackets are wrong somewhere but i just cant figure out which ones so if someone could juss help me out with my code, i would really appreciate it. thanx.
heres my code:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
// Declare Variables
int withdraw;
string name;
double acctbalance, deposit;
char choices;
acctbalance = 0;
//inputs, get the name and initial balance
cout << "Enter Name: ";
cin >> name;
cout << "Please enter initial balance: ";
cin >> acctbalance;
cout << "What do you wish to do?" << endl;
cout << "D Deposit Money" << endl;
cout << "W Withdraw Money" << endl;
cout << "B Display Balance" << endl;
cout << "Q Quit" << endl;
cin >> choices;
switch (choices)
{
case 'D':
case 'd':
{
cout << "Enter amount to be deposited: "<< endl;
cout << deposit;
if (deposit > 0)
{
acctbalance = acctbalance + deposit;
if (deposit >= 1000)
cout <<"Big Money!"<<endl;
break;
}
if (deposit == 0 || deposit < 0)
{
cout <<"Amount must be > 0";
break ;
}
}
case 'B':
case 'b':
{
cout <<"Your current balance is $ "<<acctbalance<<'.'<<endl;
if (acctbalance ==0)
cout <<"Big Money!"<<endl;
break;
}
case 'W':
case 'w':
{
cout<<"Please enter amount to withdraw "<<endl;
cout<<"Value must be multiple of 20"<<endl;
if (withdraw == 00)
{
cout << "Can't withdraw 0 dollars"<< endl;
break;
}
if (withdraw < 0)
{
cout<<"Must be a positive number"<<endl;
break;
}
if (withdraw > acctbalance)
{
cout<<"Can't withdraw more than balance"<<endl;
break;
}
if ((withdraw % 20) !=0)
{
cout<<"amount must be a multiple of 20"<<endl;
break;
}
else
{
acctbalance=acctbalance - withdraw;
cout<<"Here is your money. Enjoy!"<< endl;
break;
}
}
case 'Q':
case 'q':
{
cout<<"Thank for using our services have a nice day!"<<endl;
break;
}
}
}
}
while (choices ! = 'q' && choices ! = 'Q');
{
cout<<"Written by Ravi Mandair CPSC 1103 Assignment 1 Section10"<<endl;
}
return 0;
}