Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function call it slope_distance (its name) that accepts the coordinates of 2 points, and returns the slope of the line connecting the 2

Write a function call it "slope_distance" (its name) that accepts the coordinates of 2 points,

and returns the slope of the line connecting the 2 points, also returns the distance between the 2 points.

call this function from the main function, and let the program prints the returned values from the function "slope_distance" in the main.

slope=(y2-y1)/(x2-x1)

distance=sqrt(x2-x1)*(x2-x1)+(y2-y10*(y2-y1))

p1(x1,y1) first point

p2(x2,y2) second point

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions