Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Companies are concerned with the revenue (sales) obtained with the sales of their products and services. One company has two sales territories (Chicago and New

image text in transcribed
Companies are concerned with the revenue (sales) obtained with the sales of their products and services. One company has two sales territories (Chicago and New York). They keep track of sales amount and the number of customers in each territory. Develop a JavaScript program that will input the sales and the number of customers in each territory (both as integers and greater than 0 ). The program should calculate and output HTML text that displays the sales, the number of customers, the sales per customer, the combined sales and customer numbers, the sales per customers for all territories (see the following output). Use prompt dialogs to obtain the data from the user. Save your code as HW2-2.html Hint: You may need to code the following (part of it here): var sales, customers, salesPerCustomer, totalSales =0, totalCustomers =0, totalSalesPerCustomer, input1, input2; (You maybe you may add input 3 and input 4 if you want!) input = window.prompt ("Enter sales in Chicago: 5n, " 0); salesPerCustomer = sales / customers; 2 \begin{tabular}{l|l} salesPerCustomer-salesPerCustomer.toFixed(2); & To format a two \\ salesPerCustomer-Number(salesPerCustomer).toLocaleString0; & decimalnumber. \end{tabular} document.writeln( "

Sales in Chicago: 5n+ sales + customers + "> The number of customers in Chicago

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions