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 =

Respuesta :

Answer:

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));

  }

}