Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. // Coord.cpp : main project file.
  2.  
  3. #include "stdafx.h"
  4. #include <iostream>
  5. #include <iomanip>
  6.  
  7. using namespace std;
  8.  
  9. class Punt {
  10.  
  11. private:
  12. double x;
  13. double y;
  14. public:
  15. Punt(double xcoord = 0, double ycoord = 0);
  16. void print() const;
  17.  
  18. };
  19.  
  20. Punt::Punt(double xcoord, double ycoord) {
  21. x = xcoord;
  22. y = ycoord;
  23. }
  24.  
  25. void Punt::print() const {
  26. cout << "(" << x << "," << y << ")" << endl;
  27. }
  28.  
  29. int main(array<System::String ^> ^args)
  30. {
  31. Punt punt(5, 5);
  32. punt.print();
  33. cin.get();
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement