AVASCRIPT/HTML/CSS MODIFY THE ORIGINAL CODE TO PRODUCE DESIRED PROBLEM RESULTS - MOST WORK WILL  BE IN JS ORIGINAL CODE IS PROVDED BELOW *-----------------------------------------------------------------------------* ORIGINAL CODE *-----------------------------------------------------------------------------* HTML:            Make Change<

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

JAVASCRIPT/HTML/CSS
MODIFY THE ORIGINAL CODE TO PRODUCE DESIRED PROBLEM RESULTS - MOST WORK WILL 
BE IN JS ORIGINAL CODE IS PROVDED BELOW

*-----------------------------------------------------------------------------*
ORIGINAL CODE
*-----------------------------------------------------------------------------*
HTML:

<!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>

*-----------------------------------------------------------------------------*
JAVASCRIPT:

const $ = selector => document.querySelector(selector);
*-----------------------------------------------------------------------------*

CSS:

body {
font-family: Arial, Helvetica, sans-serif;
background-color: white;
margin: auto;
width: 600px;
border: 3px solid blue;
}
h1 {
   color: blue;
   margin-top: 0;
}
main {
padding: 1em 2em;
}
div {
   margin-bottom: 0.5em;
}
label {
   float: left;
width: 16em;
text-align: right;
}
input {
margin-left: 1em;
}
#calculate {
   margin-bottom: 1em;
}

*-----------------------------------------------------------------------------*

..

Problem 2
:Using JavaScript, create a simple web page that displays a Change Calculator,
which allows the user to enter amount of change due (0 - 99) in cents, and output the number of
each type of coins as change.
Program Requirements: Your program must be written in JavaScript. In addition, you should
follow the specific guidelines below.
• The web page displays Change Calculator as below. It should include:
o One input text box for the amount of change due in cents, and
o Four disabled output text boxes for the number of quarters, dimes, nickels and
pennies.
one Calculate button.
Change Calculator
Enter amount of change due (0-99): 67
Calculate
Quarters: 2
Dimes: 1
Nickels: 1
Pennies: 2
When the user clicks on the button Calculate,
the program validates each of the input text box, and gives an alert dialog
about the reason why the input is incorrect if the input is incorrect. The input is
required and should be numeric and greater than 0.
If the input correct, the four output text boxes will display the number of
four different types of coins. Hint: Instruction about how to calculate the number
of different coins:
• The number of quarters = parseInt (input / 25)
input_dime = input 25
The number of dimes = parseInt (input_dime/10)
• input_nickels = input_dime10
The number of nickles =
parseInt (input_nickles/5)
The number of pennies = input_nickles 5
Transcribed Image Text:Problem 2 :Using JavaScript, create a simple web page that displays a Change Calculator, which allows the user to enter amount of change due (0 - 99) in cents, and output the number of each type of coins as change. Program Requirements: Your program must be written in JavaScript. In addition, you should follow the specific guidelines below. • The web page displays Change Calculator as below. It should include: o One input text box for the amount of change due in cents, and o Four disabled output text boxes for the number of quarters, dimes, nickels and pennies. one Calculate button. Change Calculator Enter amount of change due (0-99): 67 Calculate Quarters: 2 Dimes: 1 Nickels: 1 Pennies: 2 When the user clicks on the button Calculate, the program validates each of the input text box, and gives an alert dialog about the reason why the input is incorrect if the input is incorrect. The input is required and should be numeric and greater than 0. If the input correct, the four output text boxes will display the number of four different types of coins. Hint: Instruction about how to calculate the number of different coins: • The number of quarters = parseInt (input / 25) input_dime = input 25 The number of dimes = parseInt (input_dime/10) • input_nickels = input_dime10 The number of nickles = parseInt (input_nickles/5) The number of pennies = input_nickles 5
Expert Solution
steps

Step by step

Solved in 2 steps with 1 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