1 | djbrain | 44355 |
2 | subofferul | 5220 |
3 | robica | 4610 |
4 | krystyana84 | 3980 |
5 | elena2008 | 2690 |
Membri inscrisi | 96840 |
Intrebari | 35993 |
Raspunsuri | 164903 |
C++ de
rasim83
|
|||||||||
#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<iostream.h> void main() { int choice, a; float money,m; clrscr(); void deposite(); void withdraw(); //int func1(); cout<<"Student ID : TATA_12345"<<endl; cout<<"NAME : RATAN TATA"<<endl; cout<<"(1) DEPOSITE MONEY"<<endl; cout<<"(2) WITHDRAW MONEY"<<endl; cout<<"(3) FIND THE ACCOUNT BALANCE"<<endl; cout<<"Enter your choice : "; cin>>choice; /*read the choice*/ switch (choice) { case 1: deposite(); /*to deposite money*/ break; case 2: withdraw(); /*to withdraw money*/ break; case 3: /*to see the balance*/ cout<<endl<<"This facility is not currently available"<<endl; break; default: /*if choice is not valid*/ cout<<"ERROR// PLEASE TRY AGAIN"; exit(1); } getch(); } void deposite() { float money; cout<<endl<<"Enter the amount of money to be deposited(dollars.cents):"; cin>>money; /*read the amount to be deposited*/ if(money>0) { cout<<endl<<"$"<<money<<" has been deposited in your account"<<endl; } else cout<<endl<<"Please enter valid amount......."<<endl; } void withdraw() { long int rem,f,t,e; long int mon; cout<<"Enter the amount of money to be withdrawn: "; cin>>mon; /*read the amount to be withdrawn*/ if(mon>=20) { if(mon!=30) { f=mon/50; /*decides the notes of $50*/ rem=mon%50; if(rem!=20) { if (rem==10||rem==30) { f-=1; rem+=50; } } t=rem/20; /*decides the notes of $20*/ e=rem%20; if(e==0) { cout<<endl<<"Nos. of 50$ note : "<<f; cout<<endl; cout<<"Nos. of 20$ note : "<<t<<endl; cout<<"TOTAL AMOUNT : "<<mon<<endl; } else cout<<endl<<"This amount is not possible... Please try again"<<endl; } else /*if amount is not possible*/ { cout<<endl; cout<<"This amount is not possible... Please try again"<<endl; } } else { cout<<endl; cout<<"This amount is not possible... Please try again"<<endl; } } |
Tags:
|
||||||||
|
Comentariul lui:
07-02-2012 19:00:20
Data:
|
||||||
|
||||||
* | Raspuns acceptat | Voturi: | 4 Voteaza |
Link sponsorizat | |
Comentariul lui:
03-11-2012 22:06:17
Data:
|
||||||
|
||||||
* | Comentariu | Voturi: | 3 Voteaza |
Link sponsorizat | ||
|