Guest User

Untitled

a guest
Mar 15th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. #include <windows.h>
  2. #include <string.h>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. struct osoba{
  8. string imie;
  9. string nazwisko;
  10. string pin;
  11. int stan_konta;
  12. };
  13.  
  14. int main(){
  15. cout<<"\nWitamy w banku!";
  16. cout<<"\nProsze wlozyc karte..."<<endl;
  17. int wybor,wplata,kwota,kwota_wyp;
  18. string imie, nazwisko, pin;
  19. int zalogowany;
  20. osoba tab[3];
  21.  
  22. tab[0]={"Ewa","Nowak","1324",4000};
  23. tab[1]={"Rudolf","Warczok","1122",6000};
  24. tab[2]={"Justyna","Kowalczyk","6729",6000};
  25.  
  26. for(int p=0; p<=2; p++){
  27. cout<<"Podaj imie: ";
  28. cin>>imie;
  29. cout<<"Podaj nazwisko: ";
  30. cin>>nazwisko;
  31. cout<<"Podaj PIN: ";
  32. cin>>pin;
  33. for(int a=0; a<=2; a++){
  34. if(tab[a].imie==imie && tab[a].nazwisko==nazwisko && tab[a].pin==pin){
  35. cout<<"Witaj w systemie"<<endl;
  36. zalogowany=a;
  37. a=10; p=10;
  38. }
  39. if(a==2){
  40. cout<<"Bledne login lub haslo"<<endl;
  41. }
  42. }
  43. if(p==2) cout<< "BLOKADA KARTY!"<<endl;
  44. }
  45. system("pause");
  46. system("cls");
  47. do{
  48. cout<<"1.WYSWIETL STAN KONTA.\n";
  49. cout<<"2.WPLAC GOTOWKE.\n";
  50. cout<<"3.WYPLAC GOTOWKE.\n";
  51. cout<<"4.Zakoncz.\n";
  52. cin>>wybor;
  53. switch ( wybor )
  54. {
  55. case 1:
  56. cout<<"Stan konta: "<<tab[zalogowany].stan_konta<<endl;
  57. system("cls");
  58. break;
  59. case 2:
  60. cout<<"Podaj kwote jaka chcesz wplacic: ";
  61. cin>>kwota;
  62. cout<<tab[zalogowany].stan_konta+kwota<<endl;
  63. system("cls");
  64. break;
  65. case 3:
  66. cout<<"Podaj kwote jaka chcesz wyplacic: ";
  67. cin>>kwota_wyp;
  68. cout<<tab[zalogowany].stan_konta-kwota<<endl;
  69. system("cls");
  70. break;
  71. case 4:
  72. return 0;
  73. }
  74. }while(0==0);
  75. return 0;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment