Starting from:

$30

Unit 11 Assignment CECS 524 

Unit 11 Assignment CECS 524 
Problem.
Create a class called “line”. The class line is a representation of a line on the Cartesian
plane. The line should consist of two points. Each point is an instance of the class Point.
The coordinates of Point are doubles. Design class Point keeping in mind that it will be
used within class Line.
Define the following methods for line:
 Default constructor, initializer constructor, copy constructor
 Methods to set either point independently, or both at once (explicitly named
SetPoint1(double,double), SetPoint2(double,double) and
SetLine(double,double,double,double))
 Comparison (== and !=) operators
 << and >> operators (point1 then point2 on input). Output format:
o ((x1,y1) (x2,y2))
 distance (length) of the line (named Distance( ))
 slope of the line (named Slope( ))
Test your class in a “main” function. However, keep your point.h , point.cpp, line.h and
line.cpp files separate and independent of each other and the test driver. Of course, data
members of both classes must be private.
This, of course, is C++.
Turn in all 5 files to the Unit 11 Dropbox on BB. Do not zip, tar, rar them. Put them into
a SINGLE text file or word document.

More products