Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The worksheet Items contains a list of items. For each item, it lists the unit price and a discount percentage that customers get if they
The worksheet Items contains a list of items. For each item, it lists the unit price and a discount percentage that customers get if they purchase at least a minimum quantity of the item. For example, the discount for the first product is and it is obtained if at least units are purchased.
Write a sub that asks for an item code with an input box. It should then ask for the number of units purchased, which must be a positive number. Make sure that you write code to handle possible system errors due to incorrect inputs from the user Finally, it should display a message like the following: You purchased XXX units of item XXX The total cost is XXX Because you purchased at least XXXX units, you got a discount of XXXX on each unit. The last sentence should not be displayed if the user didnt purchase enough units to get a discount.
Make sure the sub works even if the data changes, including the possibility of more or fewer items.
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