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