Write a Java program that accepts the ingredients for a recipe in cups and converts to ounces.   Inputs:  The names of three ingredients and the number of cups for each.  The ingredients are milk, flour, and sugar. Enter the first ingredient: Enter the second ingredient: Enter the third ingredient: Enter the number of cups for the first ingredient: Enter the number of cups for the second ingredient: Enter the number of cups for the third ingredient:   Outputs: There will be two lines of output: The names of the ingredients in the following format. The items inside < > are variables. The recipe uses , , and The total volume of all three ingredients in ounces in the following format. The item inside < > is a variable. The total amount of the recipe in ounces is Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program.  Step 2.  Code the program in Eclipse to read in the ingredients and amount of each, then convert to ounces and calculate total volume.  Use a printf statement to format the amount of ounces to 1 decimal place.  Use this conversion formula to convert cups to ounces. 1 US cup = 8 US ounces

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 1CP
icon
Related questions
Question

Project Name: Chpt4_Project

 

Class Name:  Chpt4_Project

 

Write a Java program that accepts the ingredients for a recipe in cups and converts to ounces.

 

Inputs:  The names of three ingredients and the number of cups for each.  The ingredients are milk, flour, and sugar.

Enter the first ingredient:

Enter the second ingredient:

Enter the third ingredient:

Enter the number of cups for the first ingredient:

Enter the number of cups for the second ingredient:

Enter the number of cups for the third ingredient:

 

Outputs: There will be two lines of output:

  1. The names of the ingredients in the following format. The items inside < > are variables.

The recipe uses <ingredient  1>, <ingredient 2>, and <ingredient 3>

  1. The total volume of all three ingredients in ounces in the following format. The item inside < > is a variable.

The total amount of the recipe in ounces is <total ounces>

Step 1. Create an algorithm (either flowchart or pseudocode) that you will use to write the program. 

Step 2.  Code the program in Eclipse to read in the ingredients and amount of each, then convert to ounces and calculate total volume.  Use a printf statement to format the amount of ounces to 1 decimal place.  Use this conversion formula to convert cups to ounces.

1 US cup = 8 US ounces

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr