Answer Input The first line is an integer N that represent the test case. Followed by N lines, where each line contains a list of newKErvOrder that end with string “closed". +Answer Sample Input-Output Input 3 spicy spicy honey boney, original griginal closed spicy honey spicy original spicy spicy, honey honey, boney, original spicy honey bonex, original original closed honey spicy spicy closed Output All Orders: original quisinal honey bonek spicy srick Total KERX Orders: 6 Total Sales: RM109.40 Number of Order Chicken Spicy: 2 Number of Order Chicken Original: 2 Number of Order Chicken Honey: 2 All Orders: original grieinal honey banek spicy original honey bone barek spicy SRICK original spicy honey spicy Total KERx Orders: 15 Total Sales: RM275.50 Number of Order Chicken Spicy: 5 Number of Order Chicken Original: 4 Number of Order Chicken Honey: 6 All Orders: spicy sRick honey Total KERX Orders: 3 Total Sales: RM59.70 Number of Order Chicken Spicy: 2 Number of Order Chicken Original: e Number of Order Chicken Honey: 1

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
1. Create a Java project named Answer
2. Define the class KEry based on the given descriptions.
3. Copy class KFryApps_Stage1.java into your project (from MS-Teams).
4. Run KFryApps_Stage1 program to get the given output.
Problem Description:
You need to construct a class KFry with all attributes as follows:
1. totalKErvOrder (int)
2. totalSales (double)
3. neQfSriekQrder(int)
4. neQfQriginalOrder(int)
5. neQfHonevQrder(int)
6. KoreanChicken(stack of String)
Create the following methods for class KEry, It is COMPULSORY to implement the concept of
stack data structure while performing each of these task.
1. Create a constructor that will set value 0.0 to attribute to totalSales and value 0 to attributes
tetalKErvOrder, neQfSrickOrder, neOfOriginaOrder and noQfHonevOrder.
2. The addOrder) method will receive newKFrvOrder and update it into the KoreanChicken
stack. This method will also update the value of three attributes; neQfSpicvQrder.
neQfQriginalOrder, and noofHonevQrder.
3. The calculateAndPrintAllOrders) method will:
i)
Print all elements of KoreanChicken stack.
ii) Count and print totalKFrvQrder. The totalKErxQrder refers to number of orders for 3
Korean chicken menus.
iii) Calculate and print the tetalSales based on the following menu price: Chicken Spicy:
RM20.90, Chicken Original: RM15.90 and Chicken Honey – RM17.90.
iv) Print out the number of order for each chicken menu.
Output from this method as shown in the 1st to 6th lines of each test case in Answer Output.
At the end of this task, the KoreanChicken stack should remain holding all menu orders as
they have been entered.
Transcribed Image Text:1. Create a Java project named Answer 2. Define the class KEry based on the given descriptions. 3. Copy class KFryApps_Stage1.java into your project (from MS-Teams). 4. Run KFryApps_Stage1 program to get the given output. Problem Description: You need to construct a class KFry with all attributes as follows: 1. totalKErvOrder (int) 2. totalSales (double) 3. neQfSriekQrder(int) 4. neQfQriginalOrder(int) 5. neQfHonevQrder(int) 6. KoreanChicken(stack of String) Create the following methods for class KEry, It is COMPULSORY to implement the concept of stack data structure while performing each of these task. 1. Create a constructor that will set value 0.0 to attribute to totalSales and value 0 to attributes tetalKErvOrder, neQfSrickOrder, neOfOriginaOrder and noQfHonevOrder. 2. The addOrder) method will receive newKFrvOrder and update it into the KoreanChicken stack. This method will also update the value of three attributes; neQfSpicvQrder. neQfQriginalOrder, and noofHonevQrder. 3. The calculateAndPrintAllOrders) method will: i) Print all elements of KoreanChicken stack. ii) Count and print totalKFrvQrder. The totalKErxQrder refers to number of orders for 3 Korean chicken menus. iii) Calculate and print the tetalSales based on the following menu price: Chicken Spicy: RM20.90, Chicken Original: RM15.90 and Chicken Honey – RM17.90. iv) Print out the number of order for each chicken menu. Output from this method as shown in the 1st to 6th lines of each test case in Answer Output. At the end of this task, the KoreanChicken stack should remain holding all menu orders as they have been entered.
Answer Input
The first line is an integer N that represent the test case. Followed by N lines, where each line
contains a list of newKFrvOrder that end with string “closed".
+Answer Sample Input-Output
Input
3
spicy spicy honey honey, original griginal closed
spicy honey spicy original spicy spicy honey honey bonex original spicy honey
boney, original original closed honey spicy spicy closed
All Orders: original original honey honek spicy spick
Total KERN, Orders: 6
Output
Total Sales: RM109.40
Number of Order Chicken Spicy: 2
Number of Order Chicken Original: 2
Number of Order Chicken Honey: 2
All Orders: original original honey banek spicy original honey bonek banex spicy
SRİGK original spicy honey spicy
Total KERN Orders: 15
Total Sales: RM275.50
Number of Order Chicken Spicy: 5
Number of Order Chicken Original: 4
Number of Order Chicken Honey: 6
All Orders: spicy SRick honey
Total KERN Orders: 3
Total Sales: RM59.70
Number of Order Chicken Spicy: 2
Number of Order Chicken Original: e
Number of Order Chicken Honey: 1
Transcribed Image Text:Answer Input The first line is an integer N that represent the test case. Followed by N lines, where each line contains a list of newKFrvOrder that end with string “closed". +Answer Sample Input-Output Input 3 spicy spicy honey honey, original griginal closed spicy honey spicy original spicy spicy honey honey bonex original spicy honey boney, original original closed honey spicy spicy closed All Orders: original original honey honek spicy spick Total KERN, Orders: 6 Output Total Sales: RM109.40 Number of Order Chicken Spicy: 2 Number of Order Chicken Original: 2 Number of Order Chicken Honey: 2 All Orders: original original honey banek spicy original honey bonek banex spicy SRİGK original spicy honey spicy Total KERN Orders: 15 Total Sales: RM275.50 Number of Order Chicken Spicy: 5 Number of Order Chicken Original: 4 Number of Order Chicken Honey: 6 All Orders: spicy SRick honey Total KERN Orders: 3 Total Sales: RM59.70 Number of Order Chicken Spicy: 2 Number of Order Chicken Original: e Number of Order Chicken Honey: 1
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education