Answered step by step
Verified Expert Solution
Link Copied!

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 5%, and it is obtained if at least 20 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

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago