SHARE
TWEET

Untitled

a guest Jan 23rd, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<fstream>
  3. #include<cstdlib>
  4. #include<string>
  5.  
  6. using namespace std;
  7.  
  8. int data_acccount_number[100], data_pin_code[100],face_value[10], bills_in_atm[100];
  9. float data_balance[100];
  10. string data_is_account_blocked;
  11.  
  12. void read_data_from_files() { // Function to read data from files
  13.     ifstream accounts_data,available_bills;
  14.     int i = 0;
  15.     int j = 0;
  16.     accounts_data.open("dane.txt");
  17.     if(accounts_data.good()==true)
  18.     {
  19.      
  20.         while (!accounts_data.eof()) {
  21.             accounts_data >> data_acccount_number[i] >> data_pin_code[i] >> data_balance[i] >> data_is_account_blocked[i];
  22.             cout << "acc nr: " << data_acccount_number[i] << " pin code: " << data_pin_code[i] << endl;
  23.             i++;
  24.         }
  25.     }
  26.     else
  27.     {
  28.         cout <<"nie udalo sie wczytac pliku dane.txt"<<endl;
  29.      }
  30.     available_bills.open("banknoty.txt");
  31.     if(available_bills.good()==true)
  32.     {
  33.        
  34.         while (!available_bills.eof()) {
  35.  
  36.             available_bills >> face_value[j] >> bills_in_atm[j];
  37.             //cout << "banknoty " << face_value[i] << " w ilosci: " << bills_in_atm[i] << endl;
  38.             j++;
  39.         }
  40.  }
  41.      else
  42.         {
  43.         cout <<"nie udalo sie wczytac pliku banknoty.txt"<<endl;
  44.      }
  45.     //cout << "acc nr: " << data_acccount_number[i] << " pin code: " << data_pin_code[i] << endl;
  46.     accounts_data.close();
  47.     available_bills.close();
  48. }
  49.  
  50.  
  51. int main(){
  52.     int ID,pin,a[100],b[100];
  53.     cout << "witaj w bankomacie" <<endl;
  54.     cout <<"podaj nr karty"<<endl;
  55.     read_data_from_files();
  56.     cin>>ID;
  57.     cin>>pin;
  58.    
  59.    
  60.    
  61.     return 0;
  62. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top