subject

You will create a program that will take in the values for two points (x1 , x2) and (y1, y2) to find the slope of a line that contains those two points. I have provided the pseudocode for you below. All you need to do is translate the pseudocode to a Python program that will run and output the correct slope.

You can test your program by entering the following two point values: (x1 , y1) –> (32, 22) and (x2 , y2) –> (53, 36). Your slope should be 2/3.

PROCEDURE getCoordinates ()
{
<< global variables predefined in starter code >>

DISPLAY (What is the value of x1?)

x1 ← INPUT()

DISPLAY (What is the value of y1?)

y1 ← INPUT()

DISPLAY (What is the value of x2?)

x2 ← INPUT()

DISPLAY (What is the value of y2?)

y2 ← INPUT()

}

PROCEDURE getSlope()

{

<< global variables predefined in starter code >>

numerator ← y2 - y1

denominator ← x2 - x1

getHighestMultiple()

numerator ← numerator / highestMultiple

denominator ← denominator / highestMultiple

DISPLAY(“Slope is ” + numerator + “/” + denominator)

}

PROCEDURE getHighestMultiple()

{

<< global variables predefined in starter code >>

temp ← numerator

while (temp > 1)

{

IF((numerator MOD temp == 0) and (denominator MOD temp == 0))

{

highestMultiple ← temp

}

temp ← temp - 1

}

}

getCoordinates();
getSlope();

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 24.06.2019 06:00
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
What are some websites that you can read manga (ex: manga rock)
Answers: 1
You know the right answer?
You will create a program that will take in the values for two points (x1 , x2) and (y1, y2) to find...
Questions
question
Mathematics, 24.07.2019 00:30
Questions on the website: 13722361