Resources
- //INIT: Using variables
- //PROCESS: Basic math
- //STYLE: Space out mathematical expressions
- math.com's formulas and tables
- basic-mathematics.com's basic math formulas
The assignment
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
- Give each text input, button, and output area an ID
-
Use Javascript to attach
onclick
to buttons andonchange
to text input areas - Create a function that will:
- 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
.innerHTML
HINT: look carefully at the //PROCESS: Basic math example code
Saving your work
Use Save as...
to save the
empty template as
"2.04S-FormulaSolver-LastName.html
"
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.