- //INIT: Using variables
- //PROCESS: Basic math
- //STYLE: Space out mathematical expressions
- math.com's formulas and tables
- basic-mathematics.com's basic math formulas
Create a page that will calculate the answer to a formula, given some information.
- Choose a formula for you to calculate
- Create a the HTML of your page. You will need:
- A title
- A description of what your page will do
- An input line for the user to enter something
- A button to trigger the calculations
- A place for an answer to appear
onclickto buttons and
onchangeto text input areas
- read the input line, and store the value in a variable
- perform a calculation, and store the result in a variable
- output the result into an element using
HINT: look carefully at the //PROCESS: Basic math example code
Saving your work
Save as... to save the empty template as
in your Computer Programming 12 directory.
Extend and expand
Use CSS to style your page.
Find the most complex formula you can with multiple variables.