subject

For the homework, choose a basic recipe with 3-5 ingredients and very simple instructions. Replace the "" with the appropriate code to get the desired information from the user and store it in the right variable. import java. util. Scanner;

public class Recipe {

public static void main (String[] args){

Scanner scan = new Scanner (System. in);

// Information about recipe
String title, instructions;

// Variables to be used (and reused)
// for each ingredient
double amount;
String ingredient;
String units;

// Each variable will be a string containing
// the name, amount, and units for one of the
// ingredients in the recipe. You may need more
// or less such variables, depending on how many
// ingredients your recipe has.
String ing1, ing2, ing3;

int component = 0;

// Get recipe title from user
System. out. print("What is this recipe called? ");


// Note that the next 8 lines will repeat
// a number of times, depending on how many
// ingredients your recipe has. The main thing
// that will change each time is the seventh
// line: ing1, ing2, ing 3, etc.
System. out. print("Ingredient #" + ++component + ": ");

System. out. print("How many? ");

System. out. print("What units? ");

ing1 = amount + " " + units + " of " + ingredient;
System. out. println();

// Second ingredient
System. out. print("Ingredient #" + ++component + ": ");

System. out. print("How many? ");

System. out. print("What units? ");

ing2 = amount + " " + units + " of " + ingredient;
System. out. println();

// Third ingredient
System. out. print("Ingredient #" + ++component + ": ");

System. out. print("How many? ");

System. out. print("What units? ");

ing3 = amount + " " + units + " of " + ingredient;
System. out. println();

// Add more code here to get fourth and fifth
// ingredients, if needed.

// Ask user for instructions. When user types out
// instructions and presses enter, you will get them in
// a string and save it to the appropriate variable
System. out. println("Please enter the instructions:");

System. out. println();

System. out. println("###" + title + "###");
System. out. println("Ingredients (" + component + " total): ");
System. out. println("* " + ing1);
System. out. println("* " + ing2);
System. out. println("* " + ing3);
System. out. println("Instructions: \n" + instructions);

}

}
Program output, when the program is run, should look something like this:
What is this recipe called? Coffee
Ingredient #1: instant coffee
How many? 1
What units? heaping teaspoon

Ingredient #2: water
How many? 0.8
What units? cups

Ingredient #3: milk
How many? 0.2
What units? cups

Please enter the instructions:
Heat the water, and stir in the instant coffee and milk.

###Coffee###
Ingredients (3 total):
* 1.0 heaping teaspoon of instant coffee
* 0.8 cups of water
* 0.2 cups of milk
Instructions:
Heat the water, and stir in the instant coffee and milk.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
6. the is particularly susceptible to the effects of alcohol because it receives a large portion of total blood flow and has a high concentration of neurons. a. heart b. pancreas c. brain d. liver
Answers: 2
question
Computers and Technology, 22.06.2019 05:30
Gerard is currently working as an entry-level customer support technician, but he would like to someday become a software developer. what is the best first step to understand what he should do? ask his manager for a new job or at least a job recommendation study graphic design in order to obtain the necessary skills use career resources to investigate what skills and education are required work part-time as an entry-level web developer question 13 (true/false worth 6 points) (08.03 lc) career resources are used to explore career options and find career information. true false question 14(multiple choice worth 6 points) (08.01 mc) classify the following skills: writing html code, evaluating color theory, using design principles. hard skills interpersonal skills people skills soft skills question 15 (true/false worth 6 points) (08.03 lc) a mentor is a person who is advised, trained, or counseled by a trusted mentee. true false
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
You know the right answer?
For the homework, choose a basic recipe with 3-5 ingredients and very simple instructions. Replace t...
Questions
question
Mathematics, 18.09.2020 01:01
question
English, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Spanish, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Physics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Geography, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Geography, 18.09.2020 01:01
question
English, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Physics, 18.09.2020 01:01
Questions on the website: 13722361