subject

35 POINTS In Java PLS
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

This is the code given:
import java. util. Scanner;

public class PickupWindow
{
public static void main(String[] args)
{
// Create scanner object
Scanner input = new Scanner(System. in);

// Display menu
String menu = "1. Hamburger\n2. Cheeseburger\n3. Veggie Burger\n4. Nachos\n5. Hot Dog\n";

System. out. println(menu);

// Get customer order
System. out. println("Enter label: ");
String customerOrder = input. nextLine();

// 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 "

}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
Learning sign language is an example of a(n) learning sign language is an example of a(n)
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
What is the purpose of a computer network needs assessment? to analyze which workers need more training to improve their performance to compare worker productivity to determine what steps employees can take to increase company revenue to evaluate how to move from the current status to the desired goal
Answers: 2
You know the right answer?
35 POINTS In Java PLS
This program is the beginning of an automated order machine. You are pr...
Questions
question
English, 21.01.2021 22:20
question
English, 21.01.2021 22:20
question
Mathematics, 21.01.2021 22:20
Questions on the website: 13722367