Question: Enter weight 1 : Enter weight 2 : Enter weight 3 : Enter weight 4 : Enter weight 5 : You entered: 2 3 6
Enter weight :
Enter weight :
Enter weight :
Enter weight :
Enter weight :
You entered: See illustration input correct space. Fix following syntax: import java.util.Scanner;
public class PeopleWeights
public static void mainString args
Scanner scnr new ScannerSystemin;
Array to store weights
double weights new double;
Prompt user for weights
for int i ; i weights.length; i
System.out.printEnter weight i :
;
weightsi scnrnextDouble;
Display entered weights
System.out.printYou entered: ;
for int i ; i weights.length; i
System.out.printweightsi;
if i weights.length
System.out.print;
System.out.print; Add space after the final output
System.out.println; Move to the next line for proper formatting
scnrclose;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
