Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write in C++ Create a class Line which consists of start and end coordinates, and line type. The default values should be as follows:

please write in C++

Create a class Line which consists of start and end coordinates, and line type. The default values should be as follows: start coordinate is (0, 0), end coordinate is (0, 0). This class should support two types of lines which are vertical (v) and horizontal (h). The default value for line type should be vertical. This class has set function which is used to set the start and end coordinates, and line type. This function should verify that the line can be drawn using the start and end coordinates based on the line type. This class also has draw function which draws a line.

First of all, you need to implement a class Coordinate. Hint: You need to calculate the length of the line in order to draw.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What tools might be helpful?

Answered: 1 week ago