Computers and Technology, 17.12.2020 17:40 sweetbri7p5v6tn
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();
Answers: 2
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
Computers and Technology, 24.06.2019 17:40
When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. this can be done by normalizing to values between 0 and 1, or throwing away outliers. for this program, adjust the values by subtracting the smallest value from all the values. the input begins with an integer indicating the number of integers that follow. ex: if the input is 5 30 50 10 70 65, the output is: 20 40 0 60 55
Answers: 1
Computers and Technology, 25.06.2019 06:20
If you want to change the speed of a layer's horizontal scrolling, what should you change? a. the x coefficient b. the y coefficient c. the virtual width d. the order of the game's layers select the best answer from the choices provided
Answers: 2
You will create a program that will take in the values for two points (x1 , x2) and (y1, y2) to find...
English, 28.01.2020 17:03
History, 28.01.2020 17:03
Mathematics, 28.01.2020 17:03
Mathematics, 28.01.2020 17:03
Biology, 28.01.2020 17:03
Mathematics, 28.01.2020 17:03
Biology, 28.01.2020 17:03
English, 28.01.2020 17:03
Mathematics, 28.01.2020 17:03
Mathematics, 28.01.2020 17:03