Advertisement
Rosboos

Untitled

Feb 26th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include "Ellipse.h"
  2. #pragma once
  3. class Ellipse
  4. {
  5. int a, b;
  6. public:
  7. Ellipse(int a, int b);
  8. void printValues();
  9. void changeValues(int a, int b);
  10. void getArea();
  11. };
  12. #include <iostream>
  13.  
  14. Ellipse::Ellipse(int a, int b) {
  15. this->a = a;
  16. this->b = b;
  17. }
  18. void Ellipse::printValues() {
  19. std::cout << "A: " << a << " " << "B: " << b << std::endl;
  20. }
  21. void Ellipse::changeValues(int a, int b) {
  22. this->a = a;
  23. this->b = b;
  24. }
  25. void Ellipse::getArea() {
  26. double area = (this->a * this->b * 3.14);
  27. std::cout << "Area: " << area << std::endl;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement