Assignment 3
Due May 28 at the start of class
This is the same day as the midtem exam, so start early
Write a program that will read an arbitrary number of prices. Stop reading
prices when -1 is entered.
-
Use the method InputBox to read values from the user.
-
Validate that each price is greater than 0 and less than 10000, or is equal
to the sentinel of -1. If a price is not valid, then display an input box
with an error message. Continue to show such an input box until the user
enters a good value.
-
Use a list box to record all the prices. Format the prices as "Fixed". Do
not include a $ sign.
-
Display the average price.
-
Display the price of the least expensive item.
-
Display the total of all the prices.
-
Display another total which is the discounted total. Calculate the discounted
total as follows:
-
If the full total is more than $100 then the least expensive item is free.
-
In addition, if the full total is more than $500 then take 20% off of every
item that is more the $50. Display each price and discounted price into another
list box. Include a heading as the first row of the list box, and be sure
that all the prices line up in one column, and all the discounted prices
line up in another. If there are no disounted items, then hide the list box.
Change the font for this list box to Courier New. Note: If the least
expensive item is more than $50, then it is not discounted since it is free.