Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given two points (x1, y1) and (x2, y2), the slope of the line running through those points is defined as rise / run, or (y2-y1)

Given two points (x1, y1) and (x2, y2), the slope of the line running through those points is defined as rise / run, or

(y2-y1) / (x2-x1)

Recall that the slope is defined as rise / run, or (y2-y1) / (x2-x1). In the previous exercise you were allowed to assume that therunwould never be 0, thus avoiding division by 0. This assumption is no longer true.

Since division by 0 is mathematically undefined, your task in this assignment is to check for a run == 0.0, and output Slope: undefined in this case. Example: given the inputs

131-3

Your program should now output

(1,3)(1,-3)Slope: undefined

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

Students also viewed these Programming questions

Question

Define self-acceptance. (p. 141)

Answered: 1 week ago