Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVASCRIPT Create a program that uses a loop, conditional statements, and a function to complete the following: Using a loop, ask the user to enter

JAVASCRIPT

Create a program that uses a loop, conditional statements, and a function to complete the following:

Using a loop, ask the user to enter the item name, price, and quantity for 3 items.

Using a function, calculate the following:

  • Calculate the cost of each item and display the cost on the screen.
  • Calculate the total cost of the three items and display the total cost on the screen.

Add a shipping charge at the end of the order based on the following conditions:

  • If the grand total is greater than $500, the shipping charge is $30.
  • If the grand total is between $200 and 499, the shipping charge is $15.
  • Otherwise, the shipping charge is $10.

Display the shipping charge.

Calculate the grand total of the order which includes the total cost of the three items with the shipping charge and display it on the screen.

All the numbers should display with 2 decimal places.

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

Ehs 2.0 Revolutionizing The Future Of Safety With Digital Technology

Authors: Tony Mudd

1st Edition

B0CN69B3HW, 979-8867463663

More Books

Students also viewed these Databases questions