Develop the change calculator - in this exercise youll


Develop the Change Calculator

In this exercise, you'll develop an application that tells how many quarters, dimes, nickels, and pennies are needed to make change for any amount of change from 0 through 99 cents. One way to get the results is to use the divide and modulus operators along with the parseInt method for truncating the results so they are whole numbers.

1. Open the HTML and JavaScript files in this folder:

exercises_extrach04change_maker

Then, run the application to see the user interface shown above, although that interface won't do anything until you develop the JavaScript for it.

1. In the JavaScript file, note that the $ function has already been coded.

2. Code an event handler named processEntries that gets the user's entry and checks to make sure that it is a number between 0 and 99. If it isn't, display an alert dialog box for the error. If it is valid, call a function named makeChange and pass it the user's entry.

3. Code the makeChange function, which should have one parameter that accepts the user's entry. This function shouldn't return anything, but it should display the results in the text boxes for Quarters, Dimes, Nickels, and Pennies.

4. Code an onload event handler that attaches the processEntries event handler to the click event of the Make Change button. Then, test this application.


Attachment:- Assignment.rar

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Develop the change calculator - in this exercise youll
Reference No:- TGS01514337

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)