One of the greatest advantages of using computers is that you can "play" with data, testing hypotheses. This is the idea behind computer simulations. In this problem, you will make it possible for a user to vary a number of parameters used in drawing parabolas on graphs.
Three major programming concepts converge in this problem: defaults, offsets, and recursion.
Defaults: The first time a script is run, the programmer must ensure that all of the variables have values that will not have dire consequences, such as causing the program to crash. When a user tries to use data which is outside the realm possible for a program, the designer uses values that are known to be OK. These are default values. (When investigating how my program works, determine which variables have defaults only for the initial execution of the program and which have them also for outlandish values. For your version of the program, make sure that you have all defaults taken care of.)
Recursion: Recursive use of a script is a method frequently used by programmers. Once the script has been accessed the first time, each action taken by the user can then trigger a certain portion of the programming code using variable settings that the user has made.
Offsets: Working with offsets is another important concept in programming. The idea is to design an object and then be able to place it anywhere you wish. In HTML, for example, a table can easily be placed at the top or bottom of a page (but not the middle) or at the left, center or right of the page. The programmers of the browsers have dealt with the offsets to make it easy for HTML programmers. Offsets were used for drawing the axes and the ticks on them: the [0, 0] points for the image and the graph were not the same.
You are to create a set of PHP scripts which will allow the user to explore the graphing of parabolas. Your page will look like the one to the right. The features that you must include are:
To enhance your program over and above what mine does, you can add other equations (third degree, linear, etc.). This can be done in either of two ways: (1) add tables and associated forms to the Driver Script or (2) add an extra layer of programming, i.e., a driver selection script (or HTML page) that allows the user to choose the type of equation to be investigated.