Question: 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
In this exercise, youll develop an application that tells how many quarters, dimes, nickels, and pennies
are needed to make change for any amount of change from through 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.
Open the application in this folder:
chchangemaker
Then, run the application to see the user interface shown above, although that interface wont do
anything until you develop the JavaScript for it In the JavaScript file, note that the $ function has
already been coded.
Code an event handler named processEntry that gets the users entry and checks to make sure that
it is a number between and If so call a function named makeChange and pass it the users
entry. Otherwise, display an alert dialog box for the error.
Code the makeChange function, which should have one parameter that accepts the users entry.
This function shouldnt return anything, but it should display the results in the text boxes for
Quarters, Dimes, Nickels, and Pennies.
Code a DOMContentLoaded event handler that attaches the processEntry event handler to the click
event of the Make Change button. Then, test this application.
Save your files in the folder above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
