Question: In C++ Write a program to test the classes pointType and lineType defined in Exercise 30 of this chapter. Add a member function to the
In C++
Write a program to test the classes pointType and lineType defined in Exercise 30 of this chapter. Add a member function to the class lineType to find the point of intersection of two lines if they are not parallel.


#include "pointType.h" class LineType public void setLineCoordinates(double a10, double b1 0, void setLineCoordinates (pointType& p1, void getLineCoordinates(pointType& p1, pointType& p2); double slope(); double a2 = 0, double b2 = 0); potntType& p2); // If line is vertical, then the function // returns-999999999999999 void lineEquation): bool isVerticalLine); bool isHorizontalLine; bool parallel(lineType&l); pointType intersectionPoint(lineType&1) lineType(double a 0, double b1-0, lineType(pointType& p1, pointType& p2); double a2 = 0, double b2 = 0); private: pointType a; pointType b; I; #include "pointType.h" class LineType public void setLineCoordinates(double a10, double b1 0, void setLineCoordinates (pointType& p1, void getLineCoordinates(pointType& p1, pointType& p2); double slope(); double a2 = 0, double b2 = 0); potntType& p2); // If line is vertical, then the function // returns-999999999999999 void lineEquation): bool isVerticalLine); bool isHorizontalLine; bool parallel(lineType&l); pointType intersectionPoint(lineType&1) lineType(double a 0, double b1-0, lineType(pointType& p1, pointType& p2); double a2 = 0, double b2 = 0); private: pointType a; pointType b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
