Question: head > - const COST _ PER _ LB = 5 0 ; const COST _ PER _ MILE = 7 5 ; const

\head>
-
const COST_PER_LB =50;
const COST_PER_MILE =75;
const SETUP_COST =500;
// Global Variables
let wgtBox = document.getElementById("wgtBox");
let distBox = document.getElementById("distBox");
let msgBox = document.getElementById("msgBox");
// Event Handlers
document.getElementById("wgtBox").onchange = calcTotal;
document.getElementById("distBox").onchange = calcTotal;
document.getElementById("setupBox").onclick = calcTotal;
// Function to calculate an estimate of the total moving cost
Gfunction calcTotal(){
let totalCost =0; // Set the initial estimate to $0
msgBox.innerHTML =""; // Erase any warnings in the message box
totalCost += wgtBox.value * COST_PER_LB;
totalCost += distBox.value * COST_PER_MILE;
if (document.getElementById("setupBox").checked){
totalCost += SETUP_COST
}
// Display the moving cost estimate in the totalBox, formatted as currency
document.getElementById("totalBox").innerHTML = formatCurrency(totalCost);
// Function to display a numeric value as a text string in the format $##.##
function formatCurrency(value){
return ""+ value.toFixed (2);
} Filename: styles.css
-*/
/* apply a natural box layout model to all elements */
Z*{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-}
/* reset rules */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
\time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 1008;
font: inherit;
vertical-align: baseline;
-}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
ffooter, header, hgroup, menu, nav, section {
display: block;
-}
Gbody {
line-height: 1;
width: 960px;
background: white;
margin: 0 auto;
font-family: Verdana, Geneva, sans-serif;
-}
Gol, ul {
list-style: none;
-}
/* page header */
Jheader {
background: #5472B2;
width: 1008;
color: #FFFFFF;
font-size: 48px;
text-align: center;
line-height: 1.5em;
-}
/* main content */
Jarticle {
width: 960px;
height: 250px;
text-align: left;
background: #FFDB70;
position: relative;
-}
Garticle h2{
font-weight: bold;
font-size: 24px;
padding: 10px;
-}
7form {
padding-left: 30px;
-}
Glabel {
display: inline-block;
width: 400px;
float: left;
clear: left;
margin-bottom: 20px;
-}
Ginput {
float: left;
marain-bottom: 20px:
Gdiv#totalBox {
width: 175px;
float: left;
outline: 1px solid gray;
height: 20px;
line-height: 20px;
font-size: 15px;
text-align: right;
background-color: white;
padding-right: 5px;
}
span {
display: inline-block;
float: left;
margin-left: 8px;
-}
lspan#msgBox {
color: red;
font-size: 1.4;
-}
\ head > - const COST _ PER _ LB = 5 0 ; const

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!