Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5.  
  6. void pause()
  7. {
  8.     cout << "Press any key to continue..." << endl;
  9.     _getch();
  10. }
  11.  
  12.  
  13. class Triangle {
  14. private:
  15.     int SideOne;
  16.     int SideTwo;
  17.     int SideThree;
  18.  
  19. public:
  20.     void set_SideOne(int x)
  21.     {
  22.         SideOne = x;
  23.     }
  24.  
  25.     void set_SideTwo(int y)
  26.     {
  27.         SideTwo = y;
  28.     }
  29.  
  30.     void set_SideThree(int z)
  31.     {
  32.         SideThree = z;
  33.     }
  34.  
  35.     int get_SideOne()
  36.     {
  37.         return SideOne;
  38.     }
  39.  
  40.     int get_SideTwo()
  41.     {
  42.         return SideTwo;
  43.     }
  44.  
  45.     int get_SideThree()
  46.     {
  47.         return SideThree;
  48.     }
  49.  
  50.     void set(int x, int y, int z)
  51.     {
  52.         SideOne = x;
  53.         SideTwo = y;
  54.         SideThree = z;
  55.     }
  56.  
  57.     void show()
  58.     {
  59.         cout << "\na = " << get_SideOne();
  60.         cout << "\nb = " << get_SideTwo();
  61.         cout << "\nc = " << get_SideThree();
  62.     }
  63. };
  64.  
  65. int main()
  66. {
  67.     Triangle tri;
  68.     tri.set(3,5,4);
  69.     tri.show();
  70.     pause();
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement