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 "


}
}

Answers

Answer 1

Answer:

Complete the program as follows:

1. Replace

String combo =

with

String combo = customerOrder.substring(0);

2. Replace

Integer comboNumber =

with

Integer comboNumber = Integer.parseInt(combo);

Explanation:

Required

Fill in the missing codes

From the code given, there are only two gaps to be filled and they are:

1. String combo =

2. Integer comboNumber =

1. String combo =

The first is to get the first index of customerOrder using substring.

The syntax of this is:

variable.substring(0);

In this case, the syntax will be replaced with:

String combo = customerOrder.substring(0);

Where customerOrder represents the string variables

2. Integer comboNumber =

This is to convert combo from string to integer using parseInt

This is done as follows:

Integer comboNumber = Integer.parseInt(combo);

See attachment for complete code


Related Questions

What are the two reasons we analyze algorithms?

Predict performance

Make decisions about what algorithm to use

Sorting Data

Ease of coding

Answers

Answer:

Predict performance  

 Make decisions about what algorithm to use

Explanation:

The two reasons we analyze algorithms are:

A. Predict performance B. Make decisions about what algorithm to use

An algorithm refers to those steps and processes which a person undertakes in order to solve a problem.

As a result of this, it is important that we make analysis of an algorithm so that we can make predictions which would help us take vital decisions about the type of algorithm to use.

Therefore, the correct answers are options A and B

Read more here:

https://brainly.com/question/17648604

The___ of a variable is determined by which parts of a program can view and change its value

Answers

The missing word is scope. Wherever a variable is declared, is its scope. A variable can be manipulated or called on only in its scope.

The scope of a variable is determined by which parts of a program can view and change its value. The correct option is C.

What is a variable?

A variable in programming is a value that can change depending on the conditions or information passed to the program.

A program is typically made up of instructions that tell the computer what to do and data that the program uses while running.

Variables are used to store data that can be accessed and manipulated by a computer program. They also allow us to label data with descriptive names, making our programs easier to understand for both the reader and ourselves.

In layman's terms, a variable's scope is its lifetime in the program. This means that the scope of a variable is the entire program's block of code where the variable is declared, used, and can be modified.

Thus, the correct option is C.

For more details regarding variable, visit:

https://brainly.com/question/17344045

#SPJ2

Your question seems incomplete, the missing options are:

influence

magnitude

scope

range

Simon takes apart a computer and looks at the thin green boards inside. What are these?
A. binary boards
B. database boards
C. input devices
D. circuit boards

Answers

Answer:

These green boards are circuit boards, these are green in color coz they protect the inner copper lining.

50 POINTS
in Java
A palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.

In this program, ask the user to input some text and print out whether or not that text is a palindrome.

Create the Boolean method isPalindrome which determines if a String is a palindrome, which means it is the same forwards and backwards. It should return a boolean of whether or not it was a palindrome.

Create the method reverse which reverses a String and returns a new reversed String to be checked by isPalindrome.

Both methods should have the signature shown in the starter code.

Sample output:

Type in your text:
madam
Your word is a palindrome!
OR

Type in your text:
hello
Not a palindrome :(

Answers

import java.util.Scanner;

public class JavaApplication52 {

   public static String reverse(String word){

       String newWord = "";

       for (int i = (word.length()-1); i >= 0; i--){

           newWord += word.charAt(i);

       }

       return newWord;

   }

   public static boolean isPalindrome(String word){

       if (word.equals(reverse(word))){

           return true;

       }

       else{

           return false;

       }

   }

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Type in your text:");

       String text = scan.nextLine();

       if (isPalindrome(text) == true){

           System.out.println("Your word is a palindrome!");

       }

       else{

           System.out.println("Not a palindrome :(");

       }

   }

   

}

I hope this works!

__ is a process of adding details to a model to make it less abstract.
• abstraction
• decomposition
• pattern recognition
• refinement

Answers

Answer:refinement

Explanation:

Answer:

refinement

Explanation: just checked

Plz answer fast! Mary needs to choose the ________ menu in order to place the text in a desired fashion around the image.

Answers

Full features menu is needed

an organization wants to use its computer to make video calls with suppliers overseasename two input and two output device that the organisation must have for this to happen and briefly explain the popruse of each device

Answers

Answer:

an organization wants to use its computer to make video calls with suppliers overseasename two input and two output device that the organisation must have for this to happen and briefly explain the popruse of each device

Please help answer now! First correct answer get branliest! Place the directions in order from first to last to explain how to hide the ribbon from the top of your Excel worksheet.

Move the cursor to the top-right corner

Select the auto-hide ribbon

Click on the up arrow

Answers

Answer:

just do bodldld

Explanation:

Answer:

Move the cursor to the top-right corner

Click on the up arrow

Select the auto-hide ribbon

Explanation:

How do you insert text into a presentation?

by clicking in a placeholder and entering text
by clicking in the task pane and entering text
by drawing a text box, clicking in it, and entering text
by selecting Text from the Insert menu

Answers

Answer:

Hello your answer is:

clicking in a placeholder and entering text

drawing a text box, clicking in it, and entering text

Explanation:

I did the assignment on edge 2021-2022

Answer: clicking in a placeholder and entering text, and

drawing a text box, clicking in it, and entering text

A swimming pool has a length of 28 feet, a width of 17 feet, and a depth of 6 feet. How much water can the swimming pool hold?

Answers

2140 Gallons/LBFOR EACH AND JOE BIDEN WONNN YAAAA

A new computer virus attacks a folder consisting of 200 files. Each file gets damaged with probability 0.2 independently of other files. What is the probability that fewer than 50 files will get damaged? g

Answers

Answer:

0.95345

Explanation:

Given that :

Number of files (n) = 200

Probability of getting damaged (p) = 0.2

q = 1 - p = 1 - 0.2 = 0.8

using normal approximation:

Mean (m) = np = 200 * 0.2 = 40

Standard deviation (s) = √n*p*q= √(200 * 0.2 * 0.8) = 5.6568542

P(X < 50)

X = 50 - 0.5 = 49.5

Find the standardized score :

Z = (x - m) / s

Z = (49.5 - 40) / 5.6568542

Z = 9.5 / 5.6568542

Zscore = 1.6793786

P(Z < 1.6793) = 0.95345 ( using Z probability calculator)

Other Questions
Why is Biodiversity considered Earth's own Safety net? Jenny and Chris share some prize money in the ratio 2:4. The prize money totaled $3000. How much did Chris win? Help please need it today Cyclic AMP phosphodiesterase is an enzyme that catalyzes the conversion of cyclic AMP to a different molecule. Which of the following best predicts the effect of inhibiting cyclic AMP phosphodiesterase in a muscle cell stimulated by epinephrine?The concentration of cyclic AMP will decrease because adenylyl cyclase will no longer be activated.The G protein will diffuse out of the cell because it will no longer bind to the plasma membrane.Phosphorylase kinase will remain active because protein kinase A will no longer be deactivated.Glycolysis will stop because epinephrine signaling will no longer stimulate glycogen breakdown. Help!! African Americans were excluded from political participation. Why was this so damaging to African Americans? What were white voters trying to prevent? Michaela solved a system of linear equations that had no solution. One of the equations was x + y = 5. The other equation had a y-intercept of 2. What was the other equation? What are the 3 main factors that can shift a PPc? GERMAN HW! Can someone please help me asap with homework? I have to use those words (look at one pic) and then describe those photos in work book. Like the 1st one they did.. if anyone understands please help.. love y'all Identify the slope from the equations y = -x -6 Help please it says round your answer to the nearest hundredth rhyme scheme of the following stanza Baby was crying so mommy was coming so daddy was also running the family was in a hurry Using complete sentences, describe how you could slice a cube with a plane and get a cross section of an equilateral triangle. If you wish, you may include a drawing in your answer. I wandered lonely as a cloud commonlit: Which of the following identifies the theme ofthe poem?A. The beauty of nature brings people pleasure.B. Nature reflects the variety of emotions thathumans feel.C.Humans rarely appreciate the beauty ofnature that surrounds them.D. Nature is the best inspiration for hopefulartists Write each algebraic expression in words. Then evaluate each expression for n = 6.a) 4n: b) n + 8: c) n/2: d) 7 + 3n: e) 10n 15: f) 50 8n: Please help :((( A recipe calls for 2 teaspoonsof sugar for every 3 cups offlour. How much sugar will beneeded for 9 cups of flour? PLEASE HELPAt the end of Act II, Scene 1 of The Diary of Anne Frank, Anne confides in Peter. How do you think Anne feels after this conversation? To whom do you talk about your problems? What qualities does that person possess that makes you go to that person? Answer these questions in your journal in a response of at least 150 words, using details from the text to support your ideas as needed. Heeeeeellllppppp pllzzzzzz Ill give brainliestttt to correct answer.With each battle of the Texas Revolution what happened to the Mexican Army?Group of answer choicesA. They were getting farther away from the Mexican capital of Mexico City.B. They had to cross mountain ranges to get to the battlefield.C. They were getting strongerD. They began to sing the praises of Santa Anna HELP ASAPMatthew made a fruit salad, in which the ratio of blueberries to red grapes is 8:6. If Matthew used 36 red grapes and the rest were blueberries. How many pieces of fruit are in Matthews fruit salad? [Type your answer as a number.] 12x-9=10x-15 Help me answer this please In 2016, about how many veterinarians in the United States were self-employed?A.) 1 in 3B.) 1 in 10C.) 1 in 4D.) 1 in 6 Read the excerpt from Hamlet.Hamlet: The fair Ophelia! Nymph, in thy orisonsBe all my sins rememberd.When Hamlet refers to Ophelia as a nymph, this is an example of a(n)