//The ATM Mahcine
#include <iostream>
using namespace std;
int main (const int)
{
int cash;
int bank;
int choice2;
int choice3;
char choice1;
cout << "please enter amoount of $ in bank: ";
cin >> bank;
cout << "please enter amount of $ in cash(hand/wallet): ";
cin >> cash;
cout << "You have " << bank << "$ in your bank.\n";
cout << "You have "<< cash << "$ in your wallet.\n";
cout << "Deposit or Withdraw?";
cin >> choice1;
if ( choice1 = choice1 )
{
cout << "How much will you deposit?\n";
cin >> choice2;
if ( choice2 <= cash )
cout << "you deposit " << choice2 << "$";
else
cout << "Insufficiant Funds...";
return 0;
}
else
{
cout << "How much will you withdraw?";
cin >> choice3;
if ( choice3 <= bank )
cout << "you withdraw " << choice3 << "$";
else
cout << "Insuffciant Funds...";
return 0;
}
return 0;
}
when i run this code on Visual C++ 2005 Express Edition,
the code dosn't give the user a choice to input deposit or withdraw,
it just automaicly goes to deposit and displays what the user inputed as the variable "cash".
PLEASE HELP ME FIX THIS PROGRAM!!!!!!!!!