A store has hired you to write a program to calculate the total cost of a customer's purchases. The customer may order books, movies, or peanuts. Books are $9 each.
Movies are $14.99 each. Peanuts are sold at $1.80 per pound and can be purchased by the tenth of a pound. The shipping cost for each book is $1.03.
The shipping cost for movies is 5% of the movie subtotal portion of the order. The shipping charge for peanuts is 50 cents per pound of peanuts ordered.
Write a client program named Ch5Proj3 that displays this exact menu
1 Books
2 Movies
3 Peanuts
4 Exit
and then prompts the user to input a menu choice (1, 2, 3, or 4). Depending on the user's inputed menu choice, the program then prompts him to input the quantity of books, movies, or peanuts
(in lbs.) that he would like to purchase. The program must output the total cost of the order. If the user types an invalid menu choice (i.e. any number other than 1, 2, or 3), display the message "Illegal
menu choice" instead of displaying the total cost and end the program. For example, if the user inputs 3 and then inputs 4.5, this means that he chose "Peanuts" as a menu choice
and then chose to purchase 4.5 pounds of peanuts. The output in this case should be $10.35 since 4.5 pounds of peanuts * 1.80 per pound of peanuts + 4.5 pounds of peanuts * 0.50 shipping cost
per pound = 10.35. If the user inputs 4 to exit, simply display a message that tells him to have a good day.
Your program
must follow the class Coding
Standards. Save all of the files associated with this assignment
to a folder named Ch5Proj3 in the appropriate network folder.
Preconditions:
- You are guaranteed that the user will input a quantity between or including 0 and 100 for the inputed amount of books, movies, or peanuts.
- You are guaranteed that the user will input a valid integer for menu choice. That is, he will type a digit like "2" instead of the word "two".
You must hand in the following on separate pages stapled in this specified order:
- The source code for the Ch5Proj3 class.
- The printscreen of your console window output after purchasing 2 movies. Be sure to print black text on white background.