University of Maryland Global Campus Design and Implement Java Program Questions
Description
Before attempting this project, be sure you have completed all the reading assignments, non-graded
exercises, discussions, and assignments to date.
Design and implement Java program as follows:
(1) There will be a Snack class with following attributes: id (combination of numbers and letters),
size (values S, M, or L), and price
(2) There will be two child classes FruitSnack and SaltySnack with the following additional
attributes:
o FruitSnack: It includes citrus fruit indication (value of this variable of is true or false)
o SaltySnack: It includes nut snack indication (value of this variable of is true or false)
(3) The Snack class hierarchy must provide the following functionality:
• On creation, a snack instance must be given all attribute values except its price, which must
be calculated
• Price is calculated as follows:
o There is a flat fee of $19.99 for S snack, $29.99 for M snack, and $39.99 for L snack.
o FruitSnack has an additional fee of $5.99 when it has a citrus fruit. Please add
only a single citrus fruit, and no preventing coding is required to limit adding more
than one.
o SaltySnack has an additional fee of $4.50 when it has a nut snack. Please add
only a single nut snack no preventing coding is required to limit adding more than
one.
• Each class must have a method to return or display the class’s values to the console
(4) Implement OrderSystem class with main method with following functionality:
o Order a snack and after ordering it will display the snack type, its size, id and price
o Exit program
See attachment for full explanation.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."