Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming Create a Point class and a Line class. Create a method in the Line class that will find (and display) the distance between

C++ Programming

Create a Point class and a Line class.

Create a method in the Line class that will find (and display) the distance between the two points entered into the Line class.

A complete program is not required.

(To compute the distance, get the difference between the x's and then the y's then use Pythagorean's theorem to find the length)

**This is what I have so far** but can't figure out how to put it together.

#include #include using namespace std;

class Point { public: int xPoint; int yPoint;

Point() { xPoint = 0; yPoint = 0; } };

class Line { public: Point startPoint; Point endingPoint;

private: int dist x; int dist y;

void displaydistance();

} ;

void Line::displaydistance(); { (a,b) (distance(point a point b) inst dist y inst dist x dist x = (c, a) dist y = (d-b) a^2+ b^2=c^2 (distx)^2(disty)^2

}

int main() {

return 0; }

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

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

Students also viewed these Databases questions

Question

Evaluate the integral. S f (x + 1)e* dx

Answered: 1 week ago

Question

What is an opportunity cost related to inventory carrying costs?

Answered: 1 week ago