Question: 3.33: Pizza Slices Individual Assignment) Use matn operators to construct an expression Use integer division Use the modulus operator to compute a remainder Store a

 3.33: Pizza Slices Individual Assignment) Use matn operators to construct an

expression Use integer division Use the modulus operator to compute a remainder

3.33: Pizza Slices Individual Assignment) Use matn operators to construct an expression Use integer division Use the modulus operator to compute a remainder Store a value in a variable Use String literals to define a String value Retrieve a value from a variable Output the value of a variable to the console Use String concatenation operator to construct an expression Concatenate the value of a variable and a String Output to console with System.out.println Problem Description and Given Info Complete a Java program that takes two int numbers as the inputs. The first number will be the total number of slices of pizza available, and the second number will be the number of people. The program should compute and output the number of pizza slices each person will get, and the number of pizza slices left over if the pizza slices are divided up so that every person gets the me number of slices. Here is an example of what the user should see when the program runs. Enter total number of slices of pizza : 33 Enter the number of people : 7 4 Number of slices each person will get : Number of slices left over : 5 Be sure to read and understand the code that you are given for this assignment below. You will be adding only the lines of code needed to compute and display the required outputs. Add the required lines where indicated by the comments in the code you are given. Make no other changes to the code you are given for this assignment. For the given inputs, make sure that your program output looks exactly like the example above (including spelling, capitalization, punctuation, spaces, and decimal points). 1 import java.util.Scanner; 2 3 public class Pizzaslices { 4 public static void main(String[] args) { 5 Scanner scnr = new Scanner(System.in); 6 7 // collect the first number from the user. 8 System.out.print("Enter total number of slices of pizza : "); 9 int totalslices = scnr.nextInt(); 10 // collect the second number from the user. 11 System.out.print("Enter the number of people : "); 12 int numberofPeople = scnr.nextInt(); 13 sys 14 il Below this comment: declare any variables you may need 15 16 17 // Below this comment: write a Java statement to compute the number of slices each person will get 18 // and store the result in a variable named slicesPerPerson. 19 20 21 // Below this comment: write a Java statement to compute the number of slices left over 22 // and store the result in a variable named slicesLeftover. 23 24 25 // Below this comment: write a Java statement to display the number of slices each person will get. 26 27 28 // Below this comment: write a Java statement to display the number of slices left over. 29 30 } 31 32

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 Databases Questions!