Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a shopping cart application with the following properties: The store sells the following products with the given tags: Bread - Food Ice Cream -
Create a shopping cart application with the following properties:
The store sells the following products with the given tags:
Bread Food
Ice Cream Food, Desert, Milk
Lettuce Food
Cupcake Food, Desert
Cake Food, Desert
Phone Electronics
Watch Electronics
Your shopping cart should use an ArrayList to store classes that implement a "Product" interface.
Your menu createddisplayed in your main method, however, your main method should not use any printprintlnprintf calls.
Instead using the singleton pattern create a class that will handle all output. You can have the singleton class take a fully formed string that it will then print or you can create methods that will emulate printprintlnprintf
Products have a getSalePrice method
All products have a base price of $
The tags have the following meaning:
Food sets price
Desert sets price
Milk sets price
Electronics sets price
Your program should provide the following menu options:
Author info
Add Bread
Add Ice Cream
Add Lettuce
Cupcake
Cake
Add Phone
Add Watch
Print prices
Exit
When a menu option from through is selected add a product combination of decorators to the products array list
When option is selected print your name and id to the screen
When option is selected print the name and sale price of all products that have been added.
Grading:
a serious attempt was made to complete the assignment
assignment uses the singleton pattern for printing
decorator pattern used to calculate prices
program compiles
author info not printed correctly
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