Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "point.h"
- #include <iostream>
- int main()
- {
- {
- float x1=0, y1=0, x2=0, y2=0;
- std::cout << "Please enter the x,y coordinates of 2 point. The distance between them will be returned:\n\n";
- std::cout << "Point 1:\n";
- std::cout << " \nx: ";
- std::cin >> x1;
- std::cout << " \ny: ";
- std::cin >> y1;
- std::cout << "\nPoint 2:\n";
- std::cout << " \nx: ";
- std::cin >> x2;
- std::cout << " \ny: ";
- std::cin >> y2;
- point x(x1,y1); //first point, initialised using the constructor
- point y(x2,y2); //second point, initialised using the constructor
- }
- float distance = 0; //variable to hold the distance
- distance =
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement