| 
put "--------------------------------------------------------------------------------"
 var y2 : real
 procedure ytwo
 put "Enter the value of y2 here: " ..
 get y2
 end ytwo
 var y : real
 procedure y1
 put "Enter the value of y(1) here: " ..
 get y
 end y1
 var x2 : real
 procedure xtwo
 put "Enter the value of x2 here: " ..
 get x2
 end xtwo
 var x : real
 procedure x1
 put "Enter the value of x(1) here: " ..
 get x
 end x1
 var continueorstop : string
 loop %LOOP STARTS HERE
 put "Welcome to Edward Yang's slope and y-intercept calculator. You can chose to havethe program to calculate just the slope or y-intercept, or both."
 %Slope m=(y2-y1)/(x2-x1)
 %Y-Int y=mx+b
 var m : real
 var b : real
 put " "
 put "Option 1: The program will calculate the slope only."
 put "Option 2: The program will only calculate the y-intercept."
 put "Option 3: The program will calculate both slope and y-intercept."
 put " "
 put "For Option 1, make sure you have the values of y2, y1, x2, and x1. The formula  that will be used to calculate the slope is m=(y2-y1)/(x2-x1)."
 put "For Option 2, make sure you have the values of y, x, and m (slope)."
 put "For Option 3, make sure y ou have the values of y2, y1, x2, x1, and the slope.  X1, and Y1 will be used to calculate the y-intercept."
 put " "
 var option : int
 put "Enter which option you want to choose (1, 2, or 3): " ..
 get option
 put "--------------------------------------------------------------------------------"
 if option = 1 then
 ytwo
 y1
 xtwo
 x1
 put " "
 put "m=y2-y1/x2-x1"
 put "m=", y2, "-", y, "/", x2, "-", x
 put "m=", y2 - y, "/", x2 - x
 m := (y2 - y) / (x2 - x) %Gives variable m a value
 put "m=", m
 put "The slope is ", m, "."
 put "--------------------------------------------------------------------------------"
 elsif option = 2 then
 x1
 y1
 put "Enter the slope here: " ..
 get m
 put " "
 put "y=mx+b"
 put y, "=", m, "*", x, "+b"
 put y, "=", m * x, "+b"
 put y, "-", m * x, "=b"
 b := y - (m * x)
 put b, "=b"
 put "The Y-Intercept is ", b, "."
 put "--------------------------------------------------------------------------------"
 elsif option = 3 then
 ytwo
 y1
 xtwo
 x1
 put " "
 put "m=y2-y1/x2-x1"
 put "m=", y2, "-", y, "/", x2, "-", x
 put "m=", y2 - y, "/", x2 - x
 m := (y2 - y) / (x2 - x) %Gives variable m a value
 put "m=", m
 put "The slope is ", m, "."
 put " "
 put "y=mx+b"
 put y, "=", m, "*", x, "+b"
 put y, "=", m * x, "+b"
 put y, "-", m * x, "=b"
 b := y - (m * x)
 put b, "=b"
 put "The Y-Intercept is ", b, "."
 put "--------------------------------------------------------------------------------"
 end if
 put "Would you like the program to continue?"
 put "Type and press enter yes if you would like to continue, no to stop the program."
 get continueorstop
 if continueorstop = "No" then
 exit
 elsif continueorstop = "no" then
 exit
 elsif continueorstop = "Yes" then
 elsif continueorstop = "yes" then
 else
 put "Since you decided to troll the program, the program will now troll you."
 %I need the sleep code to be put here
 put "The program will now stop."
 exit
 end if
 end loop
 
 |