Ask Question
27 April, 01:10

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. 27 April, 03:17
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers