Question
In C++ we need to code this program with these 4 files Point.cpp (this file should contain the implementations of your functions and should include
In C++ we need to code this program with these 4 files
Point.cpp (this file should contain the implementations of your functions and should include function comments)
Point.h (this file should contain the definition of your class, don't forget a header guard!)
main.cpp (this file should include file comment)
Makefile (this file should have a target "all", a target "main", and a target "clean". The "main" target should produce an executable from your main.cpp called "main")
Your Point class will define a 2 dimensional point (a point with an x, and y coordinate). It should have two constructors: one that takes 0 parameters and creates a point at the origin, and one that takes an x and a y value and creates a point at the given coordinates. It should have getter and setter methods for each coordinate and two methods, Distance, to calculate the Euclidian distance between this Point and another, and Translate, which moves all of this Points coordinates by whatever integer value is passed to the method. *Note that Distance and Translate are methods of the Point class.*
Your main function should create at least three points, calculate the distance between them, and report their coordinates and the calculated distances between them to the user. Do not prompt the user for the coordinates of the Points that you create.
Your main function should then translate one of the Points that you've created by a positive amount, then report the new coordinates and calculated distances to the user. It should then translate the same Point by a negative amount (this amount does not need to be the same as the positive amount), then report the new coordinates and calculated distances to the user.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started