Advertisement
Debml

mariana

Apr 21st, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main() {
  5. float a,b,c,cont1,cont;
  6. c=300;
  7. cont=1234;
  8. cout<<"Bienvenido a su cajero, introduzca la clave"<<endl; cin>>cont1;
  9. if (cont==cont1){
  10. while(1) {
  11. char opcion [2];
  12. cout << "::Menu::\n\n"
  13. << "1. Depositar\n"
  14. << "2. Retirar\n"
  15. << "3. Saldo\n"
  16. << "4. Salir\n\n"
  17. << "Opcion: ";
  18. cin >> opcion;
  19. if (opcion[0] == '1')
  20. {
  21. //system ("CLS");
  22. cout<<"cuanto desea depositar?"<<endl;
  23. cin>>b;
  24. c=c+b;
  25. cout<<"su saldo actual es de: $"<<c<<endl;
  26. //system ("PAUSE");
  27. //system ("CLS");
  28. }
  29.  
  30. else if (opcion[0] == '2')
  31. {
  32. //system ("CLS");
  33. cout<<"cuanto desea retirar"<<endl;
  34. cin>>b;
  35. if (b<= c){
  36. c=c-b;
  37. cout<<"su saldo actual es de: $"<<c<<endl;
  38. //system ("PAUSE");
  39. //system("CLS");
  40. }
  41. else {
  42. //system("CLS");
  43. cout<<"fondos insuficientes"<<endl;
  44. //system ("PAUSE");
  45. //system("CLS");
  46. }
  47.  
  48. }
  49. else if (opcion[0] == '3')
  50. {
  51. //system("CLS");
  52. cout<<"su saldo es de: $"<<c<<endl;
  53. //system ("PAUSE");
  54. //system("CLS");
  55. }
  56. else if (opcion[0] == '4')
  57. {
  58. return 0;
  59. }
  60. else
  61. {
  62. //system("CLS");
  63. cout<<"Opcion invalida"<<endl;
  64. //system ("PAUSE");
  65. //system("CLS");
  66. }
  67. }
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement