Assignment 6: Exploring Mathematical Operations
Description
Certain situations occur where a webpage may ask a user for numerical information. This information is manipulated mathematically by the program and the results are displayed to the user.
Task
Complete ExploringMathoperations.html. Attach the completed files with +Add Files.
Questions
1) What must be done in order to change the input provide to numerical information JavaScript can handle?
2) How do we modify the HTML inside an appropriate element such as <div> or <span>?
Exit Homework
HTML
Create a <div> with id output
Create an input text that allows the user to enter the amount of bill from a restaurant.
Create an input range that allows the user to specify a tip percentage. oninput call displayTip()
JavaScript
Create a variable to store the value from the input range.
Create a variable to store the value from the input text.
Create a function updateTip() that,
retrieves the value of the input range and stores the value in the variable created above.
retrieves the value of the input text and stores the value in the variable created above.
creates another variable to store the tip. Tip is calculate by multiplying the bill and the tip percentage.
diplays the tip in the output