Advertisement
Ashik_01

Untitled

May 16th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3.  
  4. using namespace std;
  5.  
  6. class ashik
  7. {
  8.     int fee;
  9.     char name[10], course[10];
  10.  
  11.     public:
  12.  
  13.     ashik(char name[10], char course[10])
  14.     {
  15.         strcpy(this->name , name);
  16.         strcpy(this->course, course);
  17.         fee = 0;
  18.     }
  19.  
  20.     ashik(char name[10], char course[10], int fee)
  21.     {
  22.         ashik :: ashik(name, course);
  23.             this->fee = fee;
  24.     }
  25.  
  26.     void display()
  27.     {
  28.         cout << name << endl << course << endl << fee<< endl;
  29.     }
  30. };
  31.  
  32.  
  33.  
  34. int main()
  35. {
  36.     ashik a1("ASHIK", "C++");
  37.     ashik a2("ARISHA", "JAVA", 1000);
  38.  
  39.     a1.display();
  40.     a2.display();
  41.  
  42.   return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement