The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write, compile, and execute a program that will calculate and display the slope of a line connecting two end points (x1, y1) and (x2, y2). Use the following formula:
Slope = (y2 - y1)/(x2 – x1)
Ask the user to input the values for the points.
Run the program four times and show all four outputs.
Keep in mind that there are 4 kinds of slopes: positive, negative, zero, and no slope. Make a comment identifying each kind of slope - positive, negative, zero, and no slope
1.The user will enter (3, 7) for (x1, y1) and (8, 12) for (x2, y2).2.The user will enter (2, 10) for (x1, y1) and (12, 6) for (x2, y2).3.The user will enter (2, 3) for (x1, y1) and (2, 4) for (x2, y2).4.The user will enter values for (x1, y1) and) for (x2, y2) such that the slope is zero).
Each line of output should look something like this:
The value of the slope for the points _______ and ______is _____.
The blanks are filled in with the appropriate values.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------