Domenii
  Top Expert
1 djbrain 44355
2 subofferul 5220
3 robica 4610
4 krystyana84 3980
5 elena2008 2690
  Top Statistici
Membri inscrisi 96840
Intrebari 35993
Raspunsuri 164903
  Contact
nume
email
Introduceti textul din imagine
(pentru evitarea spam-ului):
Numar random
 
introduceti mesajul
email admin: adip.at.myexpert.ro
Consultanta ISO, Audituri Interne - Business Advising Team
Vizualizare intrebare
Intrebare
bullet C++ de rasim83
ce face codul asta
#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:
5
puncte
1543
vizualizari
07-02-2012 16:47:14
Data intrebarii:
(0.00 - 0 voturi)
Ratings: 
Pentru a putea bifa optiunea de notificare in email in cazul adaugarii de comentarii la aceasta intrebare trebuie sa fiti logat.
Daca nu aveti cont, click Aici
Raspunsuri
Comentariul lui:
07-02-2012 19:00:20
Data:
Este in C.
Citeste niste date (cin) si apoi le afiseaza pe ecran (cout), in functie de niste conditii (if) 
* Raspuns acceptatVoturi: 4 Voteaza


Link sponsorizat

Comentariul lui:
03-11-2012 22:06:17
Data:
Este un fisier dintr-un program sau ceva

da import la niste clase de care se foloseste

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<iostream.h>

Apoi iti afiseaza/executa/inseereaza optiunile selectate si anume ,adauga bani, retrage bani,vizualizeaza balanta (cat ai depozitat .. .) si iti afiseaza niste "notite / mesaje" atunci cand ajungi la valoarea de 50$ sau de 20$  
* ComentariuVoturi: 3 Voteaza

Link sponsorizat
Raspunde / Comenteaza
Adauga un comentariu / raspuns:
Va rugam sa selectati unul din campuri: Utilizator nou Utilizator inregistrat
Ataseaza fisiere» (Max 200KB)