1. Engineering
  2. Computer Science
  3. csis 113b lab 6 the switch structure acme hardware is...

Question: csis 113b lab 6 the switch structure acme hardware is...

Question details

CSIS 113B Lab 6 The switch Structure

Acme Hardware is having a sale on widgets. As a customer you will get special pricing for a quantity of 1 to 4. The caveat is that you are only allowed to buy a maximum of 4 widgets. You are to write a program that will input the number of widgets to purchase. Then, using a switch statement compute the total amount owed for the quantity of widgets purchased.

The pricing of the widgets is as follows:

5.38

4.89 each

4.66 each

4.23 each

If a person tries to buy more than four widgets you should output a message the states they are only allowed to buy up to four. You should use the default statement to determine this.

You should have no other decisions or loops within this program. The switch statement is the only decision needed.

Your program should output like the following:

Output X Debugger Console x Lab6 (run)x How many widgets do you want to purchase? Total Cost of your widgest is $13.98 BUILD SUCCESSFUL (total time 2 seconds)

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution