Children purchase no more than 10 school supplies at a


Java program showing a Loop, Decision Structure, and an array for a company that sells school supplies to children and prints out a receipt in a console window for the user at the end.

Children purchase no more than 10 school supplies at a time (so this should be the size of any arrays you have if you need a number depending on how you set it up.)

Here is the Table of things the person operating the Java Program can choose from based on what the child chooses:

Item Number

Item Name

Price

1

Box of Crayons

4.25

2

Pencil

.15

3

Paper

.05

4

Eraser

.10

Requirements:

1. The program should ask the user for the item number for an amount of items. The user should not directly enter the price. (You will need to use Ifs or a Switch Case decision structure to find that out.)

2. The loop needs to control the entry of the item choices one by one (you can ask the user for a number of items to enter or use a sentinel variable. It is up to you. You must demonstrate a loop though.)

3. The program should store the Item Names and Prices in separate arrays (or one message with both in a string array if you want to do it that way), and it should print out all of the items at the very end of the program when the program is over.

4. Finally, print the total of all the items the user selected. There should be a total for the supplies that are being purchased at this store.

Solution Preview :

Prepared by a verified Expert
Macroeconomics: Children purchase no more than 10 school supplies at a
Reference No:- TGS01674302

Now Priced at $25 (50% Discount)

Recommended (90%)

Rated (4.3/5)