Question
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
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)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started