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               Make Change                   Change Calculator         Enter amount of change due (0-99):                                                                  Quarters:                                            Dimes:                                            Nickels:                                            Pennies:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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 2 steps with 3 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education