Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Ehs 2.0 Revolutionizing The Future Of Safety With Digital Technology

Authors: Tony Mudd

1st Edition

B0CN69B3HW, 979-8867463663

More Books

Students also viewed these Databases questions