Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. class Client{
  6. private:
  7.     char* Name;
  8.     char* Adress[100];
  9.     float Salary;
  10.     char* Tovar;
  11.     float Price;
  12.     float MesVznos;
  13.     float Dolg;
  14. public:
  15.     void Init();
  16.     void Print();
  17.     void Export();
  18. };
  19.  
  20. class Credit{
  21. public:
  22.     Client clients[5];
  23.     int CreditNumber;
  24.     char* ShopName;
  25.     void Init();
  26.     void Print();
  27.     void Export();
  28.     void TotalCost();
  29.     void TotalDebt();
  30.     void FindClient();
  31. };
  32.  
  33. void main(){
  34.    
  35.     setlocale(LC_ALL, "Russian");
  36.     Credit A;
  37.  
  38.     A.clients[0].Init();
  39.     A.clients[0].Print();
  40.     //A.Init();
  41.     //A.Print();
  42.  
  43.     getchar();
  44. }
  45.  
  46. void Client::Init(){
  47.     FILE *fp=0;  // инициализация
  48.  
  49.     fp=fopen("data\\client1.txt","r");
  50.  
  51.     char test[35];
  52.     fgets (test , 35 , fp);
  53.     cout << test << endl;
  54.     fclose(fp);
  55.  
  56.     Name = test;
  57.     cout << Name;
  58. }
  59.  
  60. void Client::Print(){
  61.     cout << Name << " " << endl; //<< Adress << " Salary: " << Salary << endl;
  62. }
  63.  
  64.  
  65. void Credit::Init(){
  66.     for (int n=0; n<5; n++)
  67.         clients[n].Init();
  68. }
  69.  
  70. void Credit::Print(){
  71.     for (int n=0; n<5; n++)
  72.         clients[n].Print();
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement