Wap to find distance between two points when the distance is represented as feet:inches system.it should use the concept of oops | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Wap to find distance between two points when the distance is represented as feet:inches system.it should use the concept of oops

code plz

12th Jan 2017, 8:53 AM
Hunter
Hunter - avatar
2 Answers
0
class Distance{ public: int pointAx; int pointAy; int pointBx; int pointBy; void setPointA(int x, int y) { pointAx = x;; pointAy = y; } void setPointB(int x, int y) { pointBx = x;; pointBy = y; } double getDistance(){ // calculate distance and return a double value } };
12th Jan 2017, 9:26 AM
Andreas K
Andreas K - avatar
0
Would also create a struct for points. Much more readability and thus, professionalism.
12th Jan 2017, 10:16 AM
Norbivar
Norbivar - avatar