SlideShare a Scribd company logo
*** Instructions included in the screenshots below! PLEASE PLEASE be sure to include all the
necessary code and ENSURE the ENTIRE post is answered. Break into steps if necessary. Thank
you!!! ***
***PLEASE PLEASE be sure to include ALL the necessary code and ENSURE the ENTIRE
post is answered. Break into steps if necessary. Thank you!!! ***
The menu at a lunch counter includes a variety of sandwiches, salads, and drinks. The menu also
allows a customer to create a "trio," which consists of three menu items: a sandwich, a salad, and
a drink. The price of the trio is the sum of the two highest-priced menu items in the trio; one item
with the lowest price is free. Each menu item has a name and a price. The four types of menu
items are represented by the four classes Sandwich, Salad, Drink, and Trio. All four classes
implement the a MenuItem interface. The following diagram shows the Menultem UML class
diagram. Figure 1: UML class diagram showing Menultem interface.
The following diagram shows the relationship between the MenuItem interface and the
Sandwich, Salad, Drink, and Trio classes. Figure 2: UML class diagram showing Menultem is
implemented by Trio and SimpleLunchltem that is extended by Sandwich, Salad, and Drink.
For example, assume that the menu includes the following items. The objects listed under each
heading are instances of the class indicated by the heading. Figure 2: Example objects of
Menultem subclasses The lunch counter wants to allow customers to create Trio menu items,
each of which includes a sandwich, a salad, and a drink. The name of the Trio consists of the
names of the sandwich, salad, and drink, in that order, each separated by "/" and followed by a
space and then "Trio". The price of the Trio is the sum of the two highest-priced items in the
Trio; one item with the lowest price is free. A trio consisting of a cheeseburger, spinach salad,
and an orange soda would have the name "Cheeseburger/Spinach Salad/Orange Soda Trio" and a
price of $4.00 (the two highest prices are $2.75 and $1.25 ). Similarly, a trio consisting of a club
sandwich, coleslaw, and a cappuccino would have the name "Club
Sandwich/Coleslaw/Cappuccino Trio" and a price of $6.25 (the two highest prices are $2.75 and
$3.50 ).
The lunch counter wants to allow customers to create Trio menu items, each of which includes a
sandwich, a salad, and a drink. The name of the Trio consists of the names of the sandwich,
salad, and drink, in that order, each separated by "/" and followed by a space and then "Trio".
The price of the Trio is the sum of the two highest-priced items in the Trio; one item with the
lowest price is free. A trio consisting of a cheeseburger, spinach salad, and an orange soda would
have the name "Cheeseburger/Spinach Salad/Orange Soda Trio" and a price of $4.00 (the two
highest prices are $2.75 and $1.25 ). Similarly, a trio consisting of a club sandwich, coleslaw,
and a cappuccino would have the name "Club Sandwich/Coleslaw/Cappuccino Trio" and a price
of $6.25 (the two highest prices are $2.75 and $3.50 ). Try and Solve It Your task is to: - Write
the Menultem interface that has two methods named getName that returns a String and a method
named getPrice that returns a double. - Write the SimpleLunchltem class which is an abstract
class that implements the Menultem interface. - Write the Trio class which implements the
Menultem interface. Your implementation must include a constructor that takes three parameters
representing a sandwich, salad, and drink. - The main method has code to test the result. If
everything works as intended your output should look like this:
Test case 1 It should print: Cheeseburger/Spinach Salad/Orange Soda Trio and it prints:
Cheeseburger/Spinach Salad/Orange Soda Trio It should print: 4.0 and it prints: 4.0 a******
Test case 2 It should print: Club Sandwich/Coleslaw/Cappuccino Trio and it prints: It should
print: 6.25 and it prints : 6.25
Main.java Salad.java SimpleLunchltem.java Menultem.java Sandwich.java Drink.java
12345classSaladextendsSimpleLunchItem{publicSalad(Stringname,doubleprice){{super(name,p
rice);}}
Main.java Salad.java x SimpleLunchltem.java x Menultem.java Sandwich.java Drink.java
Main.java Salad.java SimpleLunchltem.java Menultem.java Sandwich.java Drink.java (1) 1
// Declare the MenuItem interface.
Main.java(()234Salad.javaSimpleLunchltem.javaMenultem.javaSandwich.javaDrink.java1{{{su
per(name,price);}classSandwichextendsSimpleLunchItempublicSandwich(Stringname,doublepri
ce)Main.javaSalad.javaSimplelunchltem.javaMenultem.javaSandwich.javaDrink.java (1) class
Drink extends SimpleLunchItem public Drink(String name, double price) { super(name, price); }

More Related Content

More from ameancal

Interest rates or discount rafes. Fill in the interest rates for the .pdf
 Interest rates or discount rafes. Fill in the interest rates for the .pdf Interest rates or discount rafes. Fill in the interest rates for the .pdf
Interest rates or discount rafes. Fill in the interest rates for the .pdf
ameancal
 
Internal failure costs tend to be much lower for service organization.pdf
 Internal failure costs tend to be much lower for service organization.pdf Internal failure costs tend to be much lower for service organization.pdf
Internal failure costs tend to be much lower for service organization.pdf
ameancal
 
Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf
 Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf
Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf
ameancal
 
Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf
 Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf
Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf
ameancal
 
Instructions Complete the following excrcises. No noed to show your .pdf
 Instructions Complete the following excrcises. No noed to show your .pdf Instructions Complete the following excrcises. No noed to show your .pdf
Instructions Complete the following excrcises. No noed to show your .pdf
ameancal
 
Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf
 Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf
Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf
ameancal
 
Instructions - In Course 3 - Project Planning Putting it all togethe.pdf
 Instructions - In Course 3 - Project Planning Putting it all togethe.pdf Instructions - In Course 3 - Project Planning Putting it all togethe.pdf
Instructions - In Course 3 - Project Planning Putting it all togethe.pdf
ameancal
 
Instructions shares should receive under each of the following cond.pdf
 Instructions shares should receive under each of the following cond.pdf Instructions shares should receive under each of the following cond.pdf
Instructions shares should receive under each of the following cond.pdf
ameancal
 
Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf
 Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf
Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf
ameancal
 
inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf
 inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf
inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf
ameancal
 
Instructions C=200+0.75YI=150.pdf
 Instructions C=200+0.75YI=150.pdf Instructions C=200+0.75YI=150.pdf
Instructions C=200+0.75YI=150.pdf
ameancal
 
Instructions Submit an electronic copy of the assignment to the Drop.pdf
 Instructions Submit an electronic copy of the assignment to the Drop.pdf Instructions Submit an electronic copy of the assignment to the Drop.pdf
Instructions Submit an electronic copy of the assignment to the Drop.pdf
ameancal
 
Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf
 Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf
Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf
ameancal
 
Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf
 Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf
Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf
ameancal
 
Javier volunteers in community events each month. He does not do more.pdf
 Javier volunteers in community events each month. He does not do more.pdf Javier volunteers in community events each month. He does not do more.pdf
Javier volunteers in community events each month. He does not do more.pdf
ameancal
 
Infosys while designing a location based service for a client which p.pdf
 Infosys while designing a location based service for a client which p.pdf Infosys while designing a location based service for a client which p.pdf
Infosys while designing a location based service for a client which p.pdf
ameancal
 
Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf
 Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf
Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf
ameancal
 
Ivanhoe Corporation reported the following information for the year e.pdf
 Ivanhoe Corporation reported the following information for the year e.pdf Ivanhoe Corporation reported the following information for the year e.pdf
Ivanhoe Corporation reported the following information for the year e.pdf
ameancal
 
Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf
 Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf
Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf
ameancal
 
Items 1 through 16 represent a series of unrelated statements, questi.pdf
 Items 1 through 16 represent a series of unrelated statements, questi.pdf Items 1 through 16 represent a series of unrelated statements, questi.pdf
Items 1 through 16 represent a series of unrelated statements, questi.pdf
ameancal
 

More from ameancal (20)

Interest rates or discount rafes. Fill in the interest rates for the .pdf
 Interest rates or discount rafes. Fill in the interest rates for the .pdf Interest rates or discount rafes. Fill in the interest rates for the .pdf
Interest rates or discount rafes. Fill in the interest rates for the .pdf
 
Internal failure costs tend to be much lower for service organization.pdf
 Internal failure costs tend to be much lower for service organization.pdf Internal failure costs tend to be much lower for service organization.pdf
Internal failure costs tend to be much lower for service organization.pdf
 
Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf
 Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf
Instructions Answer ALL questions in this section. CASE STUDY Peter .pdf
 
Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf
 Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf
Instructions (a) Prepare a cost of goods manufactured schedule for Ju.pdf
 
Instructions Complete the following excrcises. No noed to show your .pdf
 Instructions Complete the following excrcises. No noed to show your .pdf Instructions Complete the following excrcises. No noed to show your .pdf
Instructions Complete the following excrcises. No noed to show your .pdf
 
Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf
 Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf
Instructions Answer ALL questions from this section CASE STUDY Cynt.pdf
 
Instructions - In Course 3 - Project Planning Putting it all togethe.pdf
 Instructions - In Course 3 - Project Planning Putting it all togethe.pdf Instructions - In Course 3 - Project Planning Putting it all togethe.pdf
Instructions - In Course 3 - Project Planning Putting it all togethe.pdf
 
Instructions shares should receive under each of the following cond.pdf
 Instructions shares should receive under each of the following cond.pdf Instructions shares should receive under each of the following cond.pdf
Instructions shares should receive under each of the following cond.pdf
 
Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf
 Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf
Inseructons Propane the Mery 11th� journat entry for Cody Compary.pdf
 
inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf
 inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf
inite anedt the keneth of time Alutrasweet cojoyicd its firt inover a.pdf
 
Instructions C=200+0.75YI=150.pdf
 Instructions C=200+0.75YI=150.pdf Instructions C=200+0.75YI=150.pdf
Instructions C=200+0.75YI=150.pdf
 
Instructions Submit an electronic copy of the assignment to the Drop.pdf
 Instructions Submit an electronic copy of the assignment to the Drop.pdf Instructions Submit an electronic copy of the assignment to the Drop.pdf
Instructions Submit an electronic copy of the assignment to the Drop.pdf
 
Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf
 Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf
Jaymes Inc. acquired all of haron Co.s connon stock on January 1 , 2.pdf
 
Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf
 Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf
Jason es un estudiante universitario de 22 a�os. Ha faltado a.pdf
 
Javier volunteers in community events each month. He does not do more.pdf
 Javier volunteers in community events each month. He does not do more.pdf Javier volunteers in community events each month. He does not do more.pdf
Javier volunteers in community events each month. He does not do more.pdf
 
Infosys while designing a location based service for a client which p.pdf
 Infosys while designing a location based service for a client which p.pdf Infosys while designing a location based service for a client which p.pdf
Infosys while designing a location based service for a client which p.pdf
 
Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf
 Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf
Iv�n, un cient�fico, invent� un m�todo para utilizar la energ�a sol.pdf
 
Ivanhoe Corporation reported the following information for the year e.pdf
 Ivanhoe Corporation reported the following information for the year e.pdf Ivanhoe Corporation reported the following information for the year e.pdf
Ivanhoe Corporation reported the following information for the year e.pdf
 
Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf
 Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf
Item 1. Bank service charges, $90. 2. Check of a customer returned by.pdf
 
Items 1 through 16 represent a series of unrelated statements, questi.pdf
 Items 1 through 16 represent a series of unrelated statements, questi.pdf Items 1 through 16 represent a series of unrelated statements, questi.pdf
Items 1 through 16 represent a series of unrelated statements, questi.pdf
 

Recently uploaded

Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
Celine George
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 

Recently uploaded (20)

Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 

Instructions included in the screenshots below! PLEASE PLEASE be.pdf

  • 1. *** Instructions included in the screenshots below! PLEASE PLEASE be sure to include all the necessary code and ENSURE the ENTIRE post is answered. Break into steps if necessary. Thank you!!! *** ***PLEASE PLEASE be sure to include ALL the necessary code and ENSURE the ENTIRE post is answered. Break into steps if necessary. Thank you!!! *** The menu at a lunch counter includes a variety of sandwiches, salads, and drinks. The menu also allows a customer to create a "trio," which consists of three menu items: a sandwich, a salad, and a drink. The price of the trio is the sum of the two highest-priced menu items in the trio; one item with the lowest price is free. Each menu item has a name and a price. The four types of menu items are represented by the four classes Sandwich, Salad, Drink, and Trio. All four classes implement the a MenuItem interface. The following diagram shows the Menultem UML class diagram. Figure 1: UML class diagram showing Menultem interface. The following diagram shows the relationship between the MenuItem interface and the Sandwich, Salad, Drink, and Trio classes. Figure 2: UML class diagram showing Menultem is implemented by Trio and SimpleLunchltem that is extended by Sandwich, Salad, and Drink. For example, assume that the menu includes the following items. The objects listed under each heading are instances of the class indicated by the heading. Figure 2: Example objects of Menultem subclasses The lunch counter wants to allow customers to create Trio menu items, each of which includes a sandwich, a salad, and a drink. The name of the Trio consists of the names of the sandwich, salad, and drink, in that order, each separated by "/" and followed by a space and then "Trio". The price of the Trio is the sum of the two highest-priced items in the Trio; one item with the lowest price is free. A trio consisting of a cheeseburger, spinach salad, and an orange soda would have the name "Cheeseburger/Spinach Salad/Orange Soda Trio" and a price of $4.00 (the two highest prices are $2.75 and $1.25 ). Similarly, a trio consisting of a club sandwich, coleslaw, and a cappuccino would have the name "Club Sandwich/Coleslaw/Cappuccino Trio" and a price of $6.25 (the two highest prices are $2.75 and $3.50 ). The lunch counter wants to allow customers to create Trio menu items, each of which includes a sandwich, a salad, and a drink. The name of the Trio consists of the names of the sandwich, salad, and drink, in that order, each separated by "/" and followed by a space and then "Trio". The price of the Trio is the sum of the two highest-priced items in the Trio; one item with the lowest price is free. A trio consisting of a cheeseburger, spinach salad, and an orange soda would
  • 2. have the name "Cheeseburger/Spinach Salad/Orange Soda Trio" and a price of $4.00 (the two highest prices are $2.75 and $1.25 ). Similarly, a trio consisting of a club sandwich, coleslaw, and a cappuccino would have the name "Club Sandwich/Coleslaw/Cappuccino Trio" and a price of $6.25 (the two highest prices are $2.75 and $3.50 ). Try and Solve It Your task is to: - Write the Menultem interface that has two methods named getName that returns a String and a method named getPrice that returns a double. - Write the SimpleLunchltem class which is an abstract class that implements the Menultem interface. - Write the Trio class which implements the Menultem interface. Your implementation must include a constructor that takes three parameters representing a sandwich, salad, and drink. - The main method has code to test the result. If everything works as intended your output should look like this: Test case 1 It should print: Cheeseburger/Spinach Salad/Orange Soda Trio and it prints: Cheeseburger/Spinach Salad/Orange Soda Trio It should print: 4.0 and it prints: 4.0 a****** Test case 2 It should print: Club Sandwich/Coleslaw/Cappuccino Trio and it prints: It should print: 6.25 and it prints : 6.25 Main.java Salad.java SimpleLunchltem.java Menultem.java Sandwich.java Drink.java 12345classSaladextendsSimpleLunchItem{publicSalad(Stringname,doubleprice){{super(name,p rice);}} Main.java Salad.java x SimpleLunchltem.java x Menultem.java Sandwich.java Drink.java Main.java Salad.java SimpleLunchltem.java Menultem.java Sandwich.java Drink.java (1) 1 // Declare the MenuItem interface. Main.java(()234Salad.javaSimpleLunchltem.javaMenultem.javaSandwich.javaDrink.java1{{{su per(name,price);}classSandwichextendsSimpleLunchItempublicSandwich(Stringname,doublepri ce)Main.javaSalad.javaSimplelunchltem.javaMenultem.javaSandwich.javaDrink.java (1) class Drink extends SimpleLunchItem public Drink(String name, double price) { super(name, price); }