Question

Amail-order housesellsfivedifferentproductswhoseretailpricesareasfollows:product1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49; and product 5, $6.87....

Amail-order housesellsfivedifferentproductswhoseretailpricesareasfollows:product1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49; and product 5, $6.87. Write a script that reads a series of pairs of numbers as follows: a) Product number b) Quantity sold for one day(html)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

Step 1: Amail sells five different products at retail prices which are given as:

  1. product 1=$2.98
  2.   product 2=$4.50
  3.   product 3=$9.98
  4. product 4=$4.49
  5. product 5=$6.87

In the program user give two inputs:

  • Enter the product no
  • Enter how quantity sold in one day

Step 2: Final output prints the total price of one day of particular product no which user enters

PROGRAM:

HTML Code :

<!DOCTYPE html> <!-- tells the version of html -->
<html>
<head>
   <title>House Products</title>

</head>
<body>
   <h1><b>House Sell Products<b></h1>
  
<script src="script.js"></script> <!-- It link the page with javascript -->

</body>
</html>

NOTE: save the above file with .html extension

JavaScript Code:

var p=prompt("enter the product no"); //Take input from user
var q=prompt("enter the no of quantity sold in one day"); //taking input
var t;   
if(p==1)
t=2.98;
if(p==2)
t=4.50;
if(p==3)
t=9.98;  
if(p==4)
t=4.49;
if(p==5)
t=6.87;

var s=t*q;

alert("your total selling price for one day is= $"+s); //Printing final results

NOTE: save the above file with script.js

Sample Input:

a>

E → X File C:/Users/User/Documents/html/np1.html This page says House Sell Products enter the product no OK Cancel

b>

E → X File C:/Users/User/Documents/html/np1.html House Sell Products This page says enter the no of quantity sold in one day

Sample Output:

€ → X File C:/Users/User/Documents/html/np1.html House Sell Products This page says your total selling price for one day is=

Add a comment
Know the answer?
Add Answer to:
Amail-order housesellsfivedifferentproductswhoseretailpricesareasfollows:product1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49; and product 5, $6.87....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A mail order house sells five different products whose retail prices are: product 1: $2.98 product...

    A mail order house sells five different products whose retail prices are: product 1: $2.98 product 2: $4.50 product 3: $9.98 product 4: $4.49 product 5: $6.87. Write a program that reads a series of pairs of numbers as follows: a) product number b) quantity sold Your program should use a switch statement to determine the retail price for each product. Your program should calculate and display the total retail value of all products sold. Use a sentinel-controlled loop to...

  • An online retailer sells five products whose retail prices are as follows: Product 1, $2.98; product...

    An online retailer sells five products whose retail prices are as follows: Product 1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49 and product 5, $6.87. Write an application in C++ that reads a series of pairs of numbers as follows: a) product number b) quantity sold Your program should use a switch statement to determine the retail price for each product. It should calculate and display the total retail value of all products sold. Use the sentinel-controlled...

  • Write a Java application that prompts the user for pairs of inputs of a product number...

    Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold (this is two separate prompts for input values). You must use a switch statement and a sentinel-controlled loop (i.e. a loop that stops execution when an out of range value, such as -1, is input). All 15 items below are for a single purchase. There are five sets of inputs as follows: Product 1    1...

  • This is in C. 4.19 (Calculating Sales) An online retailer sells five different products whose retail...

    This is in C. 4.19 (Calculating Sales) An online retailer sells five different products whose retail prices are shown in the following table: Product number Retail price $ 2.98 $ 4.50 $9.98 $ 4.49 $6.87 Write a program that reads a series of pairs of numbers as follows: a) Product number b) Quantity sold for one day Your program should use a switch statement to help determine the retail price for each product. Your program should calculate and display the...

  • For this program I ran it and it said illegal start of the expression for line...

    For this program I ran it and it said illegal start of the expression for line 49 where I have public static double how do I fix it? A bakery sells three types of muffins whose prices are as follows: 1- blueberry muffin, $2.98 2- chocolate chip muffin, $4.50 and 3- banana muffin, $9.98. You will write an application which calculates the total retail value of the sold muffins. Please check the following requirements: • Create a sentinel-controlled while loop....

  • matlab only Question 4 A restaurant sells five different desserts whose prices are shown below in...

    matlab only Question 4 A restaurant sells five different desserts whose prices are shown below in the following table: Dessert number Unit Price $ 3.98 $ 2.55 $6.90 $9.85 12.50 2 4 Write a Matiab program to display the above menu to the user. The program then prompts the customer for a key board entry of a series of pairs of numbers as follows Dessert Number: Quantity sold The program should then use switch statement to obtain the total price...

  • Task 3: Creating a Simple jQuery Application 1. Launch HTML-Kit. 2. Create a new HTML file...

    Task 3: Creating a Simple jQuery Application 1. Launch HTML-Kit. 2. Create a new HTML file and save it as nnLab8.htm. 3. Add the following HTML to the file: <!DOCTYPE HTML> <html> <head> <title>Hello World - jQuery Style</title> </head> <body> <div id="first"></div> <div id="second"></div> <a href="#" id="link">Click Me!</a><br /> <span id="greeting"></span> </body> </html> 4. Add the following<script> element to the<head> section. NOTE: Use the jQuery version number that matches the file name of the file you downloaded in Step 1....

  • (1 2 3 4 5 6 7 8 2. Let o = 4. LALO (5 4...

    (1 2 3 4 5 6 7 8 2. Let o = 4. LALO (5 4 76 2 18 3) a. Write o as a product of disjoint cycles. b. Compute ord(o) = the order of o in Sg.

  • solve questions by using fortoran.90 6. Consider the Fibonacci series: 1 1 2 3 5 8...

    solve questions by using fortoran.90 6. Consider the Fibonacci series: 1 1 2 3 5 8 13 ... Each number in the series (except the first two, which are 1) is the sum from the two previous numbers. Write a program that reads in an integer limit, and which prints the first limit terms of the series. Use an nested if block structure. (You need to distinguish between several cases: limit<0, limit=1, etc.) 7. Rewrite the previous program using a...

  • (1 point) Let f and g be permutations on the set {1, 2, 3, 4, 5,...

    (1 point) Let f and g be permutations on the set {1, 2, 3, 4, 5, 6, 7}, defined as follows (1 2 3 4 5 6 7 JE (3 1 6 5 7 2 4) f = (1 800 2 5 3 4 4 7 5 3 6 2 7 6) Write each of the following permutations as a product of disjoint cycles, separated by commas (e.g. (1,2), (3,4,5), ... ). Do not include 1-cycles (e.g. (2)) in your...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT