Rx: <15 min Av: 15-30 min Sd: 30-45 min DNF: 45+ min
ShoppingCart_uLogin
, replacing uLogin with your Drew e-mail before the ‘@’ sign.Run the code. Is the output what you expect? There are two bugs in the program. Find and fix them. After fixing the bugs, my output looks like this:
------ SUMMARY ------
Apples, $3.95
NY Yankees Tickets, $95.00
Leather boots, $145.50
Bananas, $0.79
Oranges, $1.49
------ INVOICE ------
Apples (2 lbs) $3.95
NY Yankees Tickets (behind home plate) $95.00
Leather boots (black) $145.50
Bananas (organic) $0.79
Oranges (navel) $1.49
----------------------
Total: $246.73
Highest-priced item: Leather boots, $145.50
----------------------
ShoppingCart.printSummary()
by item category: produce, entertainment, clothing, or other. If not specified, the category for an item should be “other”. Using an enumerated type, add a new category
field to the Item
class. Update ShoppingCart.printSummary()
to print the categorized summary. Make sure to set the category of each item in main. Hint: Checkout the day of the week example from classWhen finished, your program should output something like:
------ SUMMARY ------
PRODUCE:
Apples, $3.95
Bananas, $0.79
Oranges, $1.49
ENTERTAINMENT:
NY Yankees Tickets, $95.00
CLOTHING:
Leather boots, $145.50
------ INVOICE ------
Apples (2 lbs) $3.95
NY Yankees Tickets (behind home plate) $95.00
Leather boots (black) $145.50
Bananas (organic) $0.79
Oranges (navel) $1.49
----------------------
Total: $246.73
Highest-priced item: Leather boots, $145.50
----------------------