Ask Question
31 October, 17:22

Complete the PizzaCaloriesPerSlice () function to compute the calories for a single slice of pizza. A PizzaCalories () function returns a pizza's total calories given the pizza diameter passed as an argument. A PizzaSlices () function returns the number of slices in a pizza given the pizza diameter passed as an argument. qustion: Type the expression for Placeholder_B to compute the calories per slice. caloriesPerSlice =

+3
Answers (1)
  1. 31 October, 20:04
    0
    The Java code is given below with appropriate comments

    Explanation:

    //Declare the class

    public class CaloriesCount

    {

    / / Definition of the method

    public static double PizzaCaloriesPerSlice (

    double diameter)

    {

    / / To calculate calories per count

    double caloriesPerSlice = PizzaCalories (diameter)

    / PizzaSlices (diameter);

    / / return the value.

    return caloriesPerSlice;

    }

    / / Definition of method to calculate pizza calories.

    public static double PizzaCalories (double diameter)

    {

    / / return value

    return 2 * 3.14 * (diameter / 2);

    }

    / / definition to return pizza calories.

    public static double PizzaSlices (double diameter)

    {

    return 8.0;

    }

    / / start the main method.

    public static void main (String[] args)

    {

    / / Call the method.

    System. out. println (PizzaCaloriesPerSlice (24));

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Complete the PizzaCaloriesPerSlice () function to compute the calories for a single slice of pizza. A PizzaCalories () function returns a ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers