I have an Assignment ,, its about making an ATM Machine by c++
but I have an error which I couldn't find until now
I'm using viual studio 2005
Iwish that u could help ,, I'm realy tiered
the Assignment algorithm in the attachment
and this is my code ::
#include<stdlib.h>
# include < iostream.h >
int main ()
{
int accountnumber=0,balance=0,pin=0,AmountOfDeposit=0,newBalance=0,amountOfAsdding=0,choice=0;
cout<<" Welcome To the ATM Machine\n "<<endl;
cout<<" please enter your account number and you pin\n";
cin>>accountnumber;
cin>>pin;
if (accountnumber==1234,pin==54321)
{
cout<<"right account number and pin \n";
cout<<"main menu/n";
cout<<"1-view my balance./n";
cout<<"2-Withdarw Cash/n";
cout<<"3-Deposit fund/n";
cout<<"4-Exit/n";
}
else
{
cout<<"False number,,Try Again\n";
cin>>accountnumber;
cin>>pin;}
if (accountnumber==1234,pin==54321)
{
cout<<"right account number and pin \n";
cout<<"main menu/n";
cout<<"1-view my balance \n";
cout<<"2-Withdarw Cash\n";
cout<<"3-Deposit fund/\n";
cout<<"4-Exit\n";}
else
{
cout<<"False number,,Try Again\n";
cin>>accountnumber;
cin>>pin;}
if (accountnumber==1234,pin==54321)
{
cout<<"right account number and pin /n";
cout<<"main menu/n";
cout<<"1-view my balance./n";
cout<<"2-Withdarw Cash/n";
cout<<"3-Deposit fund/n";
cout<<"4-Exit/n";}
else
{
cout<<"False number,,ur card has been taken";
}
do
switch(accountnumber,pin)
{
case 1:
cout<<"your balance is 5000 Dollars/n";
system("cls");
break;
case 2:
cout<<"enter the amount u want to cash/n";
cin>>amountOfAsdding;
cout<<endl;
newBalance=balance+amountOfAsdding;
cout<<newBalance<<endl;
system("cls");
break;
case 3:
cout<<"enter the The amount of deposit into the machine/n";
cin>>AmountOfDeposit;
cout<<endl;
newBalance=balance+AmountOfDeposit;
cout<<newBalance;
cout<<endl;
system("cls");
break;
case 4:
cout<<"Are u sure ..y/n>>??";
cin>>choice;
if(choice=='y')
{
break;
}
else
{
continue;
}
default:
cout<<"choose a number from 1 to 4 /n";
}
cout<<"Do u want to do another operation y/n ..??";
cin>>choice;
while(choice=='y'||'Y');
return 0;
}
MOD EDIT: You found every stupid tag except the one you needed....the CODE tag! When you post code, USE CODE TAGS!!! It's written EVERYWHERE ON THE SITE!
Attached File(s)
-
Assignment Algorithm.doc (527.5K)
Number of downloads: 49
This post has been edited by JackOfAllTrades: 06 April 2011 - 12:51 PM
Reason for edit:: Also removed Comic Sans font and annoying colors/sizes

New Topic/Question
Reply



MultiQuote





|