Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++: In plane analytic geometry we can represent a line by the equation y = mx + b where m is called the slope

In C++:image text in transcribed

In plane analytic geometry we can represent a line by the equation y = m"x + b where m is called the slope and is a real number representing the inclination of the line in relation to the horizontal axis and b is called the y-intercept which is the location where the line crosses the vertical axis. This is to say that any line will be determined by it's two attributes m and b Create a class named line that represent lines in two dimensional planes that has the following properties 1. It contains two double variables m and b representing the slop and the y-intercept as instance variables 2. It includes a default constructor that initialize m and b to 0 3. It include a constructor that requires two arguments one for m and one for b with default value of 0 4 It include a method to translate (move) the line up or down the y-axis (vertical axis) with the new b becoming btranslation where translation is the amount by which the line is moved up or down but the slope remains the same

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

2. How do they influence my actions?

Answered: 1 week ago