Decision Logic I
Decision Logic II
Object & Event Model
This is a webpage that contains a script, that uses a function to manage a form of three text boxes. The
first text box will be input of a circle's radius and the other two text boxes output the area
and circumference of the circle. The function should be triggered by a form button.
Use the the math constant Math.PI for the constant PI.
area = PI*radius2
circumference = 2*PI*radius
Round the results to 2 decimal places. Be sure to test for a non-numeric value entered by the user and if so, then alert "Please input a numeric value".
This is a webpage that contains a script that:
Your XHTML document should contain two form buttons - one to initiate the conversion from Fahrenheit to Celsius and one to initiate the conversion from Celsius to Fahrenheit.
Create a webpage containing a script that will determine whether a
department-store customer has exceeded the credit limit on their charge account.
For input, the following facts should be available in form input text boxes:
Calculate the new balance (which equals beginning balance + charges – credits), and determine whether the new balance exceeds the customer's credit limit and by how much.
Then display in a form textarea, the new balance and whether the customer has exceeded their credit limit and by how much, by displaying the message “Credit limit exceeded by X”, where X is the amount the credit limit was exceeded.
If the customer is at or under their credit limit then display their new balance and the message "Credit available is X", where X is the amount of their available credit.
Computers are playing an increasing role in education. Write a webpage
that will help an elementary school student learn multiplication. Use
Math.random to produce two positive one-digit integers (0-9). It should
then display a question such as:
How much is 6 times 7 ?
The student then types the answer into a text field. Your programming checks the student's answer. If it is correct, display the string "Very good!" in an alert, and then prompt the user to see whether they wish to continue by using the confirm statement. If true, then generate a new question. If not, then exit the script.
If the answer to the multiplication question is wrong, display the string "No. Please try again." in an alert, and let the student try the same question again repeatedly until the student finally gets it right. A separate function should be used to generate each new question. This function should be called once when the script begins execution and each time the user answers the question correctly.