Question
URGENT~! What is wrong with the following segment of JavaScript code ( besides missing script tags - I can not enter them as they get
URGENT~!
What is wrong with the following segment of JavaScript code ( besides missing script tags - I can not enter them as they get confused with Blackboard code)?
var quart = 2; // # of quarters in a half of a year var BR = "
"; // html line break tag var ES = ""; // empty string
var saleQuart1;
var saleQuart2;
var totSale;
var avgSale;
saleQuart1 = prompt("Enter the Sales Figures for the First Quarter:",ES); saleQuart2 = prompt("Enter the Sales Figures for the Second Quarter:",ES); // Calculate total sales and average for 2 quarters totSale = saleQuart1 + saleQuart2 ; avgSale = totSale / quart;
// Display results document.write("Average for 2 quarters: " + avgSale + BR);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started