Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- float a,b,c,cont1,cont;
- c=300;
- cont=1234;
- cout<<"Bienvenido a su cajero, introduzca la clave"<<endl; cin>>cont1;
- if (cont==cont1){
- while(1) {
- char opcion [2];
- cout << "::Menu::\n\n"
- << "1. Depositar\n"
- << "2. Retirar\n"
- << "3. Saldo\n"
- << "4. Salir\n\n"
- << "Opcion: ";
- cin >> opcion;
- if (opcion[0] == '1')
- {
- //system ("CLS");
- cout<<"cuanto desea depositar?"<<endl;
- cin>>b;
- c=c+b;
- cout<<"su saldo actual es de: $"<<c<<endl;
- //system ("PAUSE");
- //system ("CLS");
- }
- else if (opcion[0] == '2')
- {
- //system ("CLS");
- cout<<"cuanto desea retirar"<<endl;
- cin>>b;
- if (b<= c){
- c=c-b;
- cout<<"su saldo actual es de: $"<<c<<endl;
- //system ("PAUSE");
- //system("CLS");
- }
- else {
- //system("CLS");
- cout<<"fondos insuficientes"<<endl;
- //system ("PAUSE");
- //system("CLS");
- }
- }
- else if (opcion[0] == '3')
- {
- //system("CLS");
- cout<<"su saldo es de: $"<<c<<endl;
- //system ("PAUSE");
- //system("CLS");
- }
- else if (opcion[0] == '4')
- {
- return 0;
- }
- else
- {
- //system("CLS");
- cout<<"Opcion invalida"<<endl;
- //system ("PAUSE");
- //system("CLS");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement