Advertisement
Guest User

code

a guest
Nov 26th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include "point.h"
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. {
  7. float x1=0, y1=0, x2=0, y2=0;
  8. std::cout << "Please enter the x,y coordinates of 2 point. The distance between them will be returned:\n\n";
  9. std::cout << "Point 1:\n";
  10. std::cout << " \nx: ";
  11. std::cin >> x1;
  12. std::cout << " \ny: ";
  13. std::cin >> y1;
  14. std::cout << "\nPoint 2:\n";
  15. std::cout << " \nx: ";
  16. std::cin >> x2;
  17. std::cout << " \ny: ";
  18. std::cin >> y2;
  19.  
  20. point x(x1,y1); //first point, initialised using the constructor
  21. point y(x2,y2); //second point, initialised using the constructor
  22. }
  23. float distance = 0; //variable to hold the distance
  24. distance =
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement