Question: Define the struct Point with components xCoordinate, and yCoordinate of type float. Define the class Line with the private data members first, and second of
Define the struct Point with components xCoordinate, and yCoordinate of type float.
Define the class Line with the private data members first, and second of type Point, length, and slope of type
float. The class also has the following public member functions:
void setfloat float, float, float; sets data in the object
void getPoint & Point & float & float & const; returns the data of the object
void print const; prints the data of the object
void findLength; finds the length of the line
void findSlope finds the slope of the line
Linefloat float float float; default parametrize constructor
Save the struct and class definitions in the Line.h file, the main driver in the Line.cpp file, and the
implementation of the member functions in the LineImp.cpp file.
Implement all the member functions of the class and enforce the least privilege principle. Use the following
main program:
int main
Line side;
side.set;
side.print;
return ;
Sample input output:
In mathematics, the slope or gradient of a line is a number that describes both the direction and the
steepness of the line.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
