Question

Programming Challenges 145 6. Ingredient Adjuster A cookie recipe calls for the following ingredients: • 1.5 cups of sugar •
1 0
Add a comment Improve this question Transcribed image text
Answer #1

solution;

//IngredientAdjuster.java

import java.util.Scanner;

public class IngredientAdjuster {

public static void main(String[] args){

    double sugar = 1.5/48;

    double butter = 1.0/48;

    double flour = 2.75/48;

    Scanner scanner = new Scanner(System.in);

    System.out.print("Number of cookies you need: ");

    int n = scanner.nextInt();

    System.out.println("\nYou need:");

    System.out.println((sugar*n)+" cups of sugar");

    System.out.println((butter*n)+" cups of butter");

    System.out.println((flour*n)+" cups of flour");

}

}

Number of cookies you need: 75 You need: 2.34375 cups of sugar 1.5625 cups of butter 4.296875 cups of flour Process finished

> Great thanks for the help your work is really appreciated

Crosscriss482 Wed, Dec 29, 2021 7:30 AM

Add a comment
Know the answer?
Add Answer to:
Programming Challenges 145 6. Ingredient Adjuster A cookie recipe calls for the following ingredients: • 1.5...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A cookie recipe calls for the following ingredients: • 1.5 cups of sugar • 1 cup...

    A cookie recipe calls for the following ingredients: • 1.5 cups of sugar • 1 cup of butter • 2.75 cups of flour The recipe produces 48 cookies with this amount of ingredients. Write a program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient needed for the specified number of cookies in the following format: You need 5 cups of sugar, 3 cups of butter, and 7...

  • 3. Jim is making shortbread cookies. The recipe calls for 1 cup of butter, 'cup sugar,...

    3. Jim is making shortbread cookies. The recipe calls for 1 cup of butter, 'cup sugar, and 243 cups flour. Jim had already put in the 1 cup of butter and 24 cups flour, but then he accidentally added 1 cup of sugar to the mixture. Which of the following shows how much butter and flour he must now add to achieve the proportion? A) 1 cup of butter and 2 cups flour B) 1 cup of butter and 1...

  • 15. The following recipe is for a spice cake Ingredients 3 % cups cake flour 3%...

    15. The following recipe is for a spice cake Ingredients 3 % cups cake flour 3% teaspoon double acting baking powder I teaspoon salt 2 teaspoons cinnamon 5 teaspoon cloves 2 teaspoons grated orange rind 2/3 cup vegetable oil 4 cup water ½ cup skimmed milk 4 egg whites 4 tsp cream of tartar 1 ½ cups sugar teaspoon allspice Procedure I. Grease two 9-inch square pans, and preheat oven to 375 2. Sift together into a mixing bowl the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT