Question: Please help me answer problem 2 . Thank you! If you split al 1 this pizza evenly among 1 2 people, you will have 4

Please help me answer problem 2. Thank you!
If you split al1 this pizza evenly among 12 people,
you will have 4 slices left over.
Mmmm! Cold pizza...
$ java PizzasAndPeop7e
how many pizzas? 3?-
how many slices per pizza? 10
how many people? 7
If you split al1 this pizza evenly among 7 people, y
ou wil1 have 2 slices left over.
Mmmm! Cold pizza... Problem 2
This problem is very similar to Problem 1, and you can use your solution to Problem 2 as starter code.
The inputs are the same, but the output is a bit different: rather than telling the user how many slices in total will be left after you give each person
their slices, display the number of whole pizzas that can be assembled from what is left, plus the number of slices that don't add up to a whole pie.
Sample Runs:
$ java PizzasForThePeople
how many pizzas? 7
how many slices per pizza? 6
how many peop1e?12
If you split al1 this pizza evenly among 12 people,
you will have 1 whole pizzas and 0 slices left over.
Mmmm! Cold pizza...
$ java PizzasForThePeople
how many pizzas? 9
how many slices per pizza? 8
how many peop1e?25
If you sp1it a11 this pizza evenly among 25 people,
you wil1 have 2 whole pizzas and 6 slices left over.
Mmmm! Cold pizza...
$ java PizzasForThePeople
how many pizzas? 3
how many slices per pizza? 10
how many people? 4
If you split all this pizza evenly among 4 people, y
ou will have 0 whole pizzas and 2 slices left over.
Mmmm! Cold pizza...
Please help me answer problem 2 . Thank you! If

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!