Learn how to program with arrays. You will create a Java application using Bluej
ID: 3640773 • Letter: L
Question
Learn how to program with arrays. You will create a Java application using Bluej splits up a pizza bill: The program should ask how many people are eating pizza, the total slices, and the total price for the pizza. Use this number to determine the size of the array you will use in the next step. Then, for each person eating, ask how many slices that person ate and store it in an array. The program should then output a summary indicating how many slices each person ate and how much they owe. User input is in red.Explanation / Answer
PS: Please rate the answer import java.util.Scanner; class Pizza { public static void main(String args[]) { int userinput, total=0; int ppl[]; double cost; Scanner in = new Scanner(System.in); System.out.println("How many people are eating?"); userinput = in.nextInt(); ppl = new int[userinput]; System.out.println("Home many slices?"); userinput = in.nextInt(); System.out.println("How much did the pizza cost?"); cost = in.nextDouble(); for(int i=0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.