You are now designing a tool to calculate the profit, where the bakery sells bread, cookie, and cake. You are suggested to follow steps a-e to achieve the above described:< a. Create bakery.txt as follows and save it in the same directory of your project. [5 marks] In the first row, the unit profit of bread is HKD $3.8. In the second row, the unit profit of cookie is HKD $18.8. In the third row, the unit profit of cake is HKD $38.8. 4 BREAD 3.8 COOKIE 18.8 CAKE 38.8 b. Locate your project named as your student ID. • New a Java class named SID_assgnl_program2. In the main method, read the input file created in step a, and throw a FileNotFoundException if the input file does not exist. [5 marks] [5 marks] Store the numbers read from the input file to proper variables. c. Prompt the user to input “Please input the type (e.g. BREAD/COOKIE/CAKE)" and take user's input. Next, prompt the user to input "Please input the quantity (e.g. 180.00)" and take user's input. [5 marks] Sample run for c:< Please input the type (e.g. BREAD/COOKIE/CAKE):bread Please input the quantity (e.g. 180.0):180.0 Thank you for your input. Fig 6 d. Calculate the profit using users' input (e.g. quantity) achieved in step c, as well as the different unit profit rates achieved in step a. The following formula is needed to calculate the profit. [10 marks] Hint: Depending on the specific type (specified in step c). please use the different unit profits achieved in step a.< total profit = unit profit * quantity. a. Print out the total profit of the bakery. Sample run for e (given input in step c):< (1) Please input the type (e.g. BREAD/COOKIE/CAKE):bread Please input the quantity (e.g. 180.0): 180.0 Thank you for your input. The total profit = HKD$684.00 [10 marks] 4

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
Please input the type (e.g. BREAD/COOKIE/CAKE):CAKE
Please input the quantity (e.g. 180.0):80.0
Thank you for your input.
(2) The total profit = HKD$3104.00
Fig 74
End
Transcribed Image Text:Please input the type (e.g. BREAD/COOKIE/CAKE):CAKE Please input the quantity (e.g. 180.0):80.0 Thank you for your input. (2) The total profit = HKD$3104.00 Fig 74 End
2. Problem Specification
[40 marks]
You are now designing a tool to calculate the profit, where the bakery sells bread, cookie, and cake.
You are suggested to follow steps a-e to achieve the above described:<
a. Create bakery.txt as follows and save it in the same directory of your project. [5 marks]
In the first row, the unit profit of bread is HKD $3.8. In the second row, the unit profit of cookie
is HKD $18.8. In the third row, the unit profit of cake is HKD $38.8.
BREAD 3.8
COOKIE 18.8
CAKE 38.8
b. Locate your project named as your student ID. <
• New a Java class named SID_assgn1_program2. In the main method, read the input file
created in step a, and throw a FileNotFoundException if the input file does not exist.
[5 marks]
[5 marks]
•
Store the numbers read from the input file to proper variables.
c. Prompt the user to input "Please input the type (e.g. BREAD/COOKIE/CAKE)" and take
user's input. Next, prompt the user to input "Please input the quantity (e.g. 180.00)" and take
user's input.
[5 marks]
Sample run for c:<
Please input the type (e.g. BREAD/COOKIE/CAKE):bread
Please input the quantity (e.g. 180.0):180.0
Thank you for your input.
Fig 64
d. Calculate the profit using users' input (e.g. quantity) achieved in step c, as well as the
different unit profit rates achieved in step a. The following formula is needed to calculate the
profit.
[10 marks]
Hint: Depending on the specific type (specified in step c), please use the different unit profits
achieved in step a.
total profit = unit profit * quantity.<
a. Print out the total profit of the bakery.
Sample run for e (given input in step c):<
(1)
[10 marks]
Please input the type (e.g. BREAD/COOKIE/CAKE):bread
Please input the quantity (e.g. 180.0): 180.0
Thank you for your input.
The total profit = HKD$684.00
Transcribed Image Text:2. Problem Specification [40 marks] You are now designing a tool to calculate the profit, where the bakery sells bread, cookie, and cake. You are suggested to follow steps a-e to achieve the above described:< a. Create bakery.txt as follows and save it in the same directory of your project. [5 marks] In the first row, the unit profit of bread is HKD $3.8. In the second row, the unit profit of cookie is HKD $18.8. In the third row, the unit profit of cake is HKD $38.8. BREAD 3.8 COOKIE 18.8 CAKE 38.8 b. Locate your project named as your student ID. < • New a Java class named SID_assgn1_program2. In the main method, read the input file created in step a, and throw a FileNotFoundException if the input file does not exist. [5 marks] [5 marks] • Store the numbers read from the input file to proper variables. c. Prompt the user to input "Please input the type (e.g. BREAD/COOKIE/CAKE)" and take user's input. Next, prompt the user to input "Please input the quantity (e.g. 180.00)" and take user's input. [5 marks] Sample run for c:< Please input the type (e.g. BREAD/COOKIE/CAKE):bread Please input the quantity (e.g. 180.0):180.0 Thank you for your input. Fig 64 d. Calculate the profit using users' input (e.g. quantity) achieved in step c, as well as the different unit profit rates achieved in step a. The following formula is needed to calculate the profit. [10 marks] Hint: Depending on the specific type (specified in step c), please use the different unit profits achieved in step a. total profit = unit profit * quantity.< a. Print out the total profit of the bakery. Sample run for e (given input in step c):< (1) [10 marks] Please input the type (e.g. BREAD/COOKIE/CAKE):bread Please input the quantity (e.g. 180.0): 180.0 Thank you for your input. The total profit = HKD$684.00
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Project Analysis
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
  • SEE MORE 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