Home HTML →True Basic →Chapter 1 →Chapter 1_2 →Chapter 2 →Chapter 3 →Chapter 4 →Chapter 5 →Linear Functions Program →→Phase I →→Phase II Article Reviews |
!Jeremy Fallick !Period 6 !Linear Functions Program !Problem: Create a program that will use data inputted by the user to create the equation of, display information about, and plot a line. !Inputs/Ouputs: Choice$, a, b, c, x, y, x-int, y-int, m, x1, y1, x2, y2 !Test Data/Hand-worked Example: !Please choose from the following: !A.....The slope and y-intercept of your function. !B.....Two ordered pairs that lie on the graph of your function. !C.....The slope of a line perpendicular to your function and the coordinates of a point on the graph of your function. !D.....The slope of a line parallel to your function and the coordinates of a point on the graph of your function. !E.....The slope of your function and one ordered pair that lies on the graph of your function. !F.....The coefficients of the general form of the equation of your function General form:(Ax + By = C). !G.....Exit the Program !What is your choice? f !This is the General Form sub, it is now currently under construction. !Please come back to see us after work is completed. !Algorithm: ! !Level 0 ***************************************************** !Display Welcome Message !Repeat the following until the user enters "G" (choice to quit) !Menu ! !Level 1 ***************************************************** !Menu !Repeat the following until choice >=A and <=G (is valid choice) !Display menu choices !Prompt for and get choice !Convert choice to uppercase !If not valid ! Display error message !If choice = A ! SlopeIntercept !If choice = B ! TwoPoints !If choice = C ! Perpendicular !If choice = D ! ParallelSlope !If choice = E ! PointSlope !If choice = F ! GeneralForm ! !Level 2 ***************************************************** !SlopeIntercept !Display Welcome to slope intercept sub message !Display 'Under Construction' message ! !TwoPoints !Display Welcome to Two Points sub message !Display 'Under Construction' message ! !Perpendicular !Display Welcome to Perpendicular sub message !Display 'Under Construction' message ! !ParallelSlope !Display Welcome to Parallel Slope sub message !Display 'Under Construction' message ! !PointSlope !Display Welcome to Point Slope sub message !Display 'Under Construction' message ! !GeneralForm !Display Welcome to General Form sub message !Display 'Under Construction' message !Code: Print "Welcome to Jeremy F's Linear Functions Program." do call Menu(choice$) loop until choice$="G" end sub Menu(choice$) do print "Please choose from the following:" print "A.....The slope and y-intercept of your function." print "B.....Two ordered pairs that lie on the graph of your function." print "C.....The slope of a line perpendicular to your function" print "and the coordinates of a point on the graph of your function." print "D.....The slope of a line parallel to your function and the coordinates of a point on the graph of your function." print "E.....The slope of your function and one ordered pair that lies on the graph of your function." print "F.....The coefficients of the general form of the equation of your function General form:(Ax + By = C)." print "G.....Exit the program." input prompt "What is your choice?":choice$ let choice$=UCASE$(choice$) If choice$>"G" then print "INVALID INPUT" end if If choice$ = "A" then call SlopeIntercept end if If choice$ = "B" then call TwoPoints end if If choice$ = "C" then call Perpendicular end if If choice$ = "D" then call ParallelSlope end if If choice$ = "E" then call PointSlope end if If choice$ = "F" then call GeneralForm end if loop until choice$>="G" end sub sub SlopeIntercept print "Welcome to the Slope Intercept Sub!" print "We are under construction right now." print "Please come see us when construction is completed." print "We apologize for the inconvience." end sub sub TwoPoints print "Welcome to the Two Points Sub!" print "We are under construction right now." print "Please come see us when construction is completed." print "We apologize for the inconvience." end sub sub Perpendicular print "Welcome to the Perpendicular Sub!" print "We are under construction right now." print "Please come see us when construction is completed." print "We apologize for the inconvience." end sub sub ParallelSlope print "Welcome to the Parallel Slope Sub!" print "We are under construction right now." print "Please come see us when construction is completed." print "We apologize for the inconvience." end sub sub PointSlope print "Welcome to the Point Slope Sub!" print "We are under construction right now." print "Please come see us when construction is completed." print "We apologize for the inconvience." end sub sub GeneralForm print "Welcome to the General Form Sub!" print "We are under construction right now." print "Please come see us when construction is completed." print "We apologize for the inconvience." end sub |