Ask Question

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.

Answers (1)
  1. 14 December, 14:13
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers
Sign In
Ask Question