Ask Question
6 March, 12:20

Complete the PizzaCaloriesPerSlice () function to compute the calories for a single slice of pizza. A Pizza Calories () 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.

+5
Answers (1)
  1. 6 March, 16:06
    0
    Answer: Provided in the explanation section

    Explanation:

    The question tells us to;

    Complete the PizzaCaloriesPerSlice () function to compute the calories for a single slice of pizza. A Pizza Calories () 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.

    The answer to this goes like this:

    1.

    totalCalories = pizzaCalories (pizzaDiameter);

    Explanation: As mentioned in question pizzaCalories method will return total calories.

    2.

    caloriesPerSlice = totalCalories/pizzaSlices (pizzaDiameter);

    Explanation: As mentioned in question pizzaSlices will return number of pizza slices. so dividing total calories by pizzaSlices () will give us caloriesPerSlice.
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 Pizza Calories () 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