dumbluii
dumbluii dumbluii
  • 09-10-2020
  • Computers and Technology
contestada

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

Respuesta :

sandlee09
sandlee09 sandlee09
  • 13-10-2020

Answer:

Explanation:

public static int cupsToOunces (int cups) {

   

       int ounces = cups * 8;

       return ounces;

       

   }

This is a very simple Java method that takes in the number of cups in the recipe as a parameter, converts it to ounces, and then returns the number of ounces. It is very simple since 1 cup is equal to 8 ounces, therefore it simply takes the cups and multiplies it by 8 and saves that value in an int variable called ounces.

Answer Link

Otras preguntas

Choose the plural possessive noun that completes the following sentence.
what graph is used for exponential growth?​
Determine whether the given value is a solution of the equation. b 6; b =78 13 78 (select) a solution. is 78 the solution or not
What is the value of m? A. 67 B. 73 C. 90 D. 140 What is the value of n? A. 107 B. 113 C. 115 D. 140
A postscript is ______. A) the date B) part of the body C) one last thought D) the closing
how much acid is in the world
A proteins function is dependent on its?
A place’s distance above or below sea level is its __________. A. projection B. distortion C. estimation D. elevation Please select the best answer from the cho
How did Polish immigrants react to a Lithuanian priest at their Chicago parish, St. Stanislaus Kostka? What does this say about relationships between immigrant
how do i find the area of a triangle if the base is x and the height is 2x