Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using C++ Create a class called line to hold two X,Y coordinate pairs. Create a project Create a main() to test the following specified class.

using C++

Create a class called line to hold two X,Y coordinate pairs.

Create a project Create a main() to test the following specified class.
Create the class to hold two x,y coordinate pairs. Store the coordinate pairs as doubles. 

Since two coordinate pairs can describe a line solve the standard y = mx + bequation for slope and y-intercept (b).

? Create two constructors for this line. One an empty one and one the takes are the parameter

Create a mutator function that will allow the user to update the parameters of the line class.

? Create a method to calculate and return the slope.

? Create a method to calculate and return the y-intercept.

? Create a method to determine if the line is vertical. It should

 return a bool. 

? Create a method to determine if the line is horizontal . It

 should return a bool. 

? Create a method to display the parameters of the line.

Finally, treating these coordinate pairs as the lower and upper

coordinates of a rectangle calculate/display the width, height and area of this rectangle.

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

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions