Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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 application in this folder:
ch04\change_maker\
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.
2. Code an event handler named processEntry() that gets the users entry and checks to make sure that
it is a number between 0 and 99. If so, call a function named makeChange() and pass it the users
entry. Otherwise, display an alert dialog box for the error.
3. 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.
4. Code a DOMContentLoaded event handler that attaches the processEntry() event handler to the click
event of the Make Change button. Then, test this application.
5. Save your files in the folder above.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

Demonstrate the effective development of creative briefs.

Answered: 1 week ago

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago