mes, 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 provided:change_makerThen, run the application to see the user interface shown above, although that interface won’t do anything until you develop the JavaScript for it. 2. In the JavaScript file, note that the $() function has already been coded. 3. Code an event handler named processEntry() that gets the user’s entry and checks to make sure that it is a number between 0 and 9

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

I need help with Javascript code for this assignment. The HTML code is at the bottom. Thank you!

Develop the Change CalculatorIn 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 application provided:change_makerThen, run the application to see the user interface shown above, although that interface won’t do anything until you develop the JavaScript for it.

2. In the JavaScript file, note that the $() function has already been coded.

3. Code an event handler named processEntry() that gets the user’s 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 user’s entry. Otherwise, display an alert dialog box for the error.

4. 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.

5. Code a DOMContentLoaded event handler that attaches the processEntry() event handler to the click event of the Make Change button. Then, test this application.

 

Here is the HTML code

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Make Change</title>
    <link rel="stylesheet" href="make_change.css">
</head>

<body>
    <main>
        <h1>Change Calculator</h1>

        <label>Enter amount of change due (0-99):</label>
        <div>
            <input type="text" id="cents" />
            <input type="button" value="Calculate" name="calculate" id="calculate" />
        </div>
        <div>
            <label>Quarters:</label>
            <input type="text" id="quarters" disabled>
        </div>
        <div>
            <label>Dimes:</label>
            <input type="text" id="dimes" disabled>
        </div>
        <div>
            <label>Nickels:</label>
            <input type="text" id="nickels" disabled>
        </div>
        <div>
            <label>Pennies:</label>
            <input type="text" id="pennies" disabled>
        </div>
    </main>
    <script src="make_change.js"></script>
</body>
</html>
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY