Question: 1. Creating a BlueJ Project Create a BlueJ project and create a Class called RecipeProgram. If you need help with using BlueJ refer to the

1. Creating a BlueJ Project Create a BlueJ project and create a Class called RecipeProgram.

If you need help with using BlueJ refer to the Unit 5: IDEs lecture

Open the editor, and replace the automatically generated source code with the following:

import java.util.Scanner; public class RecipeProgram { static Scanner in = new Scanner(System.in); // Program function public static void main(String args[]) { System.out.println( "COOKIE RECIPE PROGRAM" ); } }

2. Declaring variables Declare the following variables as Doubles: batches tspBakingSoda tspBakingPowder cupsButter cupsSugar amountEggs

Compile your program before continuing! Fix any errors that pop up!

3. Input and output Next, display a message to the user using System.out.println( "..." );, replacing ... with the message: Ask the user How many batches of cookies to make?

Next, you will use the Scanner object to get input from the user and store it in the batches variable, like this: batches = in.nextDouble();

Compile your program and run it before continuing to verify that it works correctly!

4. Math operations Then you will assign values to each of the ingredient variables, multiplied by the number of batches. Assign the following values to each: tspBakingSoda is 1.0 * batches tspBakingPowder is 0.5 * batches cupsButter is 1.0 * batches cupsSugar is 1.5 * batches amountEggs is 1.0 * batches

Display each of the variables to the screen, WITH labels for what they represent.

(

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!