Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

School Supply Shop Write a java program for a company that sells school supplies to children and prints out a receipt in a console window

School Supply Shop

Write a java program 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

3.50

2

Notebook

1.05

3

Pencil

.15

4

Candy

.75

Requirements:

1. The program should ask the user for the item number for a number 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 from the number 1-4 they give you as the choice.)

2. The program should have a loop 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 by using a loop to print the values in the array(s) out.

4. Finally, the program should also 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.

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions