Question: In Javascript without using lists or arrays Assignment #1: Grocery List Create a program that lets users record their shopping list, and approximate the amount

In Javascript without using lists or arrays

Assignment #1: Grocery List

Create a program that lets users record their shopping list, and approximate the amount of money they'll owe at checkout.

First, ask for an item (e.g., "bananas"), then the price (e.g., 1.29). Ensure that only valid data is accepted: items must not be blank, and prices must neither be blank nor be zero or less; re-prompt until you get valid responses. Keep asking until the user for items and prices until she enters "DONE" (without the quotes) when asked for an item. In the DONE case, do not prompt the user for the price (there's no point in that). While data entry is happening, a list should be written to the document, under an attractive heading. Put an asterisk next to any item that is $10.00 or more.

After DONE is entered, display another heading for the summary. Then list the number of items to be purchased along with the total amount they'll spend on the shopping trip. Sample output is shown below.

List

Item: Bananas, Price: $1.29 Item: Milk, Price: $1.99 Item: Laundry detergent, Price: $12.99* Item: Salad mix, Price: $3.99

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 Databases Questions!