Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <string.h>
- #include <iostream>
- using namespace std;
- struct osoba{
- string imie;
- string nazwisko;
- string pin;
- int stan_konta;
- };
- int main(){
- cout<<"\nWitamy w banku!";
- cout<<"\nProsze wlozyc karte..."<<endl;
- int wybor,wplata,kwota,kwota_wyp;
- string imie, nazwisko, pin;
- int zalogowany;
- osoba tab[3];
- tab[0]={"Ewa","Nowak","1324",4000};
- tab[1]={"Rudolf","Warczok","1122",6000};
- tab[2]={"Justyna","Kowalczyk","6729",6000};
- for(int p=0; p<=2; p++){
- cout<<"Podaj imie: ";
- cin>>imie;
- cout<<"Podaj nazwisko: ";
- cin>>nazwisko;
- cout<<"Podaj PIN: ";
- cin>>pin;
- for(int a=0; a<=2; a++){
- if(tab[a].imie==imie && tab[a].nazwisko==nazwisko && tab[a].pin==pin){
- cout<<"Witaj w systemie"<<endl;
- zalogowany=a;
- a=10; p=10;
- }
- if(a==2){
- cout<<"Bledne login lub haslo"<<endl;
- }
- }
- if(p==2) cout<< "BLOKADA KARTY!"<<endl;
- }
- system("pause");
- system("cls");
- do{
- cout<<"1.WYSWIETL STAN KONTA.\n";
- cout<<"2.WPLAC GOTOWKE.\n";
- cout<<"3.WYPLAC GOTOWKE.\n";
- cout<<"4.Zakoncz.\n";
- cin>>wybor;
- switch ( wybor )
- {
- case 1:
- cout<<"Stan konta: "<<tab[zalogowany].stan_konta<<endl;
- system("cls");
- break;
- case 2:
- cout<<"Podaj kwote jaka chcesz wplacic: ";
- cin>>kwota;
- cout<<tab[zalogowany].stan_konta+kwota<<endl;
- system("cls");
- break;
- case 3:
- cout<<"Podaj kwote jaka chcesz wyplacic: ";
- cin>>kwota_wyp;
- cout<<tab[zalogowany].stan_konta-kwota<<endl;
- system("cls");
- break;
- case 4:
- return 0;
- }
- }while(0==0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment