public class PeopleWeights

import java.util.Scanner;

public class PeopleWeights {

   public static void main(String[] args) {

        double sum = 0;

        double highest = 0;

         double [] v=new double[10];

         Scanner scanner = new Scanner(;


System.out.println(“Enter weight “+(i+1)+”: “);

         v[i] = scanner.nextFloat();


System.out.print(“\nYou entered: “);


System.out.printf(“%.02f “,v[i]);

         sum = sum+v[i];   //find sum

         //comparing each time entered number with large one

         if(v[i] > highest)

         highest = v[i];


         double average=(double)sum/5;

System.out.printf(“\nTotal weight: %.02f  “,sum);

System.out.printf(“\nAverage weight: %.02f “,average);

System.out.printf(“\nMax weight: %.02f “,highest);



"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"