Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code in c++, Please separate them into pointType.h, pointType.cpp, lineType.h, lineType.cpp, and main.cpp files. Also please show screenshotes of the output 1. Define a class
Code in c++, Please separate them into pointType.h, pointType.cpp, lineType.h, lineType.cpp, and main.cpp files. Also please show screenshotes of the output
1. Define a class pointType to implement the properties of a point in a 2D space. The class must contain functions to individually set and retrieve the x and y coordinates which are private attributes of the class, and computes the distance between that point and another point. The x and y coordinates are initialized via a constructor. If p1 and p2 are pointType objects, then p1.distance(p2) returns the distance between p1 and p2. 2. Define a class line Type with two private data members of type pointType to store the coordinates of two points in a line. Among other functions, your class must contain functions to determine if a line is vertical, horizontal or slanted. If the line is a slanted line, compute the slope of the line. The output should be the equation of a line in the slope intercept form. For example, if the line is vertical, the equation of the line should be x=a, where a is a real number. The main function should prompt the user to give input for the two x and y coordinates for the pointsStep 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