Advertisement
endreweast

lab3

Dec 9th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. class Bank
  7. {
  8.     private:
  9.         char apps[30];
  10.     protected:
  11.         int type;
  12.     public:
  13.         char *p;
  14.         char name[30];
  15.         int number;
  16.         float adress;
  17.         float weight;
  18.         Bank()
  19.         {
  20.             number=0;
  21.             adress=0;
  22.             weight=0;
  23.         }
  24.         Bank(int l, int z, float x, float c)
  25.         {
  26.             type=l;
  27.             number=z;
  28.             adress=x;
  29.             weight=c;
  30.         }
  31.         ~Bank()
  32.         {
  33.             cout << "Constructor Delete" << endl;
  34.         }
  35.         void read()
  36.         {
  37.             cout << "Write apps:" << endl;
  38.             cin >> apps;
  39.             cout << "Write type:" << endl;
  40.             cin >> type;
  41.             cout << "Write name:" << endl;
  42.             cin >> name;
  43.             cout << "Write number:" << endl;
  44.             cin >> number;
  45.             cout << "Write adress:" << endl;
  46.             cin >> adress;
  47.             cout << "Write weight:" << endl;
  48.             cin >> weight;
  49.         }
  50.         void moving()
  51.         {
  52.            
  53.         }
  54.         void display()
  55.         {
  56.         cout << "Apps=" << apps << endl;
  57.         cout << "Type=" << type << endl;
  58.         cout << "Name=" << name << endl;
  59.         cout << "Number=" << number << endl;
  60.         cout << "Adress=" << adress << endl;
  61.         cout << "Weight=" << weight << endl;
  62.         }
  63.         void sorting()
  64.         {
  65.            
  66.         }
  67.        
  68. };
  69. int main()
  70. {
  71.         Bank obj;
  72.         obj.~Bank();
  73.         obj.read();
  74.         obj.moving();
  75.         obj.display();
  76.         obj.sorting();
  77.         system("PAUSE");
  78.     return 0;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement