blic class Pickupwindow extends ConsoleProgram ublic void run() // Display menu String menu = "1. Hamburger\n2. Cheeseburger\n3. Veggie Burger\n4. Nachos System.out.println(menu); // Get customer order String customerorder = readLine("Enter label: "); // Use substring to get the first character (the number) String combo = // Create an Integer object by using the static // method Integer.valueof (someString) // to turn the string into an Integer Integer comboNumber = // Print out what the customer ordered System.out.println("Customer ordered number "

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

solve in java

1
public class Pickupwindow extends ConsoleProgram
2-
public void run()
{
// Display menu
String menu = "1. Hamburger\n2. Cheeseburger\n3. Veggie Burger\n4. Nachos\n5. Hot Dog\n";
3
6
7
8
system.out.println(menu);
9
// Get customer order
string customerorder = readLine("Enter label: ");
10
11
12
13
14
15
16
// Use substring to get the first character (the number)
String combo
// Create an Integer object by using the static
// method Integer.valueof(someString)
// to turn the string into an Integer
17
18
19
20
Integer comboNumber =
21
// Print out what the customer ordered
System.out.println("Customer ordered number
22
23
24
25
26
}
27
Transcribed Image Text:1 public class Pickupwindow extends ConsoleProgram 2- public void run() { // Display menu String menu = "1. Hamburger\n2. Cheeseburger\n3. Veggie Burger\n4. Nachos\n5. Hot Dog\n"; 3 6 7 8 system.out.println(menu); 9 // Get customer order string customerorder = readLine("Enter label: "); 10 11 12 13 14 15 16 // Use substring to get the first character (the number) String combo // Create an Integer object by using the static // method Integer.valueof(someString) // to turn the string into an Integer 17 18 19 20 Integer comboNumber = 21 // Print out what the customer ordered System.out.println("Customer ordered number 22 23 24 25 26 } 27
This program is the beginning of an automated order machine. You are
programming the piece that gets the number of the order from the label sent
to you by the ordering machine.
The ordering machine is simulated with user input. It sends a full label, such as
“3. Veggie Burger".
Fill in the missing code
Your task is to get the number out of the string. To do this, you need to isolate
the number by using substring. Then use Integer.valueOf , a static method
of Integer that takes a String and returns the integer value contained in the
String.
The final program should look something like this
1. Hamburger
2. Cheeseburger
3. Veggie Burger
4. Nachos
5. Hot Dog
Enter label:
5. Hot Dog
Customer ordered number 5
Transcribed Image Text:This program is the beginning of an automated order machine. You are programming the piece that gets the number of the order from the label sent to you by the ordering machine. The ordering machine is simulated with user input. It sends a full label, such as “3. Veggie Burger". Fill in the missing code Your task is to get the number out of the string. To do this, you need to isolate the number by using substring. Then use Integer.valueOf , a static method of Integer that takes a String and returns the integer value contained in the String. The final program should look something like this 1. Hamburger 2. Cheeseburger 3. Veggie Burger 4. Nachos 5. Hot Dog Enter label: 5. Hot Dog Customer ordered number 5
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Dynamic Multithreading
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