Code is here to be copied #include <iostream> using namespace std; class ATM { private: double withdraw,deposit; double balance=0; int input; public: void disply() { cout<<"1........To Deposit money into Account \n"; cout<<"2.........Withdraw money form account \n"; cout<<"3.......To Display balance \n"; cout<<".......... Please Type 0 For Exit your Transection \n"; cout<<"Enter YOUR Choice Number ::"; cin>>input; } void Transection() { while(input!=0) { switch(input) { case 1: cout<<" Enter a sum you wish to Deposit to Your account :"; cin>>deposit; balance=balance+deposit; cout<<"You have to Deposit in your account is :"<<deposit<<endl; break; case 2: if(deposit<withdraw) cout<<"please Check You balance "<<endl; else { cout<<" Enter a sum You wish to Withdraw :"; cin>>withdraw; balance=balance-withdraw; cout<<" You have Withdraw "<<withdraw<<endl; } break; case 3: cout<<"The current Balance in Your account is :"<<balance<<endl; break; default : cout<<" You have Enter a Wrong input Please Check your input "<<endl; } cout<<" :: Enter Choice:: "; cin>>input; } } }; int main() { ATM check; check.disply(); check.Transection(); // check.condition(); return 0; }
1 comment:
Test comment
Post a Comment