24 1444 LAB 18.22.1: FinalNum2 ACTVITY 0/15 FinalNum2.java Load defautt template class FinalN 4 public static void maincString args) String Oname- ("Plain", "Glazed", "Sprinkles", "Ohocolate", "Boston Creme"}: double cost- (0.5e, e.75, a.75, e.9s, 1.45): System.out.printin("hat kind of donut do you wont?); /input the name of a cookte from the keyboard 10 11 System.out.printin("How mony do you want?"); input the number of cooktes 13 12 14 15 /find the nome of the cookte in the name orray, and note its index tind the cost of the cookte in the cost array 16 17 18 19 Run your program as often as you'd ike, before submitting for grading. Below. type any needed input values in the first box, then click Run program and observe the programs output inthe seccod box Develop mode Submit mode

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
Topic Video
Question

Use Java and follow the instructions as much as possible.

The user is asked to enter the name of a donut, and the nunmber s/he wishos to buy.
The cost of the order is caleulated and output.
281444
LAB
18.22.1: FinalNum2
ACTMITY
0/15
FinalNum2.java
Load default template.
2 class FinalNum2
4 public static void nain(String args)
String Onome- ("Plain", "Glazed", "Sprinkles", "Ohocelete", "Boston Creme):
7.
double cost - (0.5e, e.75, 0.75, e.95, 1.45);
Systen.out.printin("whot kind of donut do you want?");
//input the name of a cookte from the keyboord
10
11
12
13
System.out.println("How mony do you want?);
/input the number of cookies
14
15
//find the nome of the cookte in the name orroy, and note its index
//ind the cost of the cookie in the cost orroy
16
17
18
19
Run your program as often as you'd ike, before submitting for grading. Below, type any needed
inout values in the first box, then click Run program and observe the program's output in the
Develop mode
Submit mode
second box
MacBook Air
16
F4
23
24
8.
3
4
6
Transcribed Image Text:The user is asked to enter the name of a donut, and the nunmber s/he wishos to buy. The cost of the order is caleulated and output. 281444 LAB 18.22.1: FinalNum2 ACTMITY 0/15 FinalNum2.java Load default template. 2 class FinalNum2 4 public static void nain(String args) String Onome- ("Plain", "Glazed", "Sprinkles", "Ohocelete", "Boston Creme): 7. double cost - (0.5e, e.75, 0.75, e.95, 1.45); Systen.out.printin("whot kind of donut do you want?"); //input the name of a cookte from the keyboord 10 11 12 13 System.out.println("How mony do you want?); /input the number of cookies 14 15 //find the nome of the cookte in the name orroy, and note its index //ind the cost of the cookie in the cost orroy 16 17 18 19 Run your program as often as you'd ike, before submitting for grading. Below, type any needed inout values in the first box, then click Run program and observe the program's output in the Develop mode Submit mode second box MacBook Air 16 F4 23 24 8. 3 4 6
The user is anked to enter the name of a donut, and the nuaber s/he vishes to buy.
The cont of the order is calculated and output.
24OM 14744
LAI
18.22.1: FinalNum2
ACTIVITY
0/15
FinalNum2.java
Load default terrplate
13
//input the number of cookies
14
15
16
//find the nome of the cookie in the name orray, and note its index
//find the cost of the cookie in the cost array
17
18
19
20
21
//calculate the cost of the order (cost of one cookie number of cookies)
22
23
24
25
26 System.out.printin("The cost of the order is S total):
27 //end main
28 1//end class
29
30
//output the total cost
Run your program as often as youd like, before submitting for grading Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
second bor
Develop mode
Submit mode
MacBook Air
11
14
FL
%23
2$
8
6
4.
5
Transcribed Image Text:The user is anked to enter the name of a donut, and the nuaber s/he vishes to buy. The cont of the order is calculated and output. 24OM 14744 LAI 18.22.1: FinalNum2 ACTIVITY 0/15 FinalNum2.java Load default terrplate 13 //input the number of cookies 14 15 16 //find the nome of the cookie in the name orray, and note its index //find the cost of the cookie in the cost array 17 18 19 20 21 //calculate the cost of the order (cost of one cookie number of cookies) 22 23 24 25 26 System.out.printin("The cost of the order is S total): 27 //end main 28 1//end class 29 30 //output the total cost Run your program as often as youd like, before submitting for grading Below, type any needed input values in the first box, then click Run program and observe the program's output in the second bor Develop mode Submit mode MacBook Air 11 14 FL %23 2$ 8 6 4. 5
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Instruction Format
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.
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