Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Can someone fix this for me! Please? (https://www.askmehelpdesk.com/showthread.php?t=805747)

  • Dec 12, 2014, 12:42 AM
    sesa
    Can someone fix this for me! Please?
    Can someone please! Fix this for me?


    My program :
    loop reads 10 double numbers
    after that
    inserts them into an array list.
    after that
    print MAx and MIn And AVg


    THIS MY PROGRAM WHY I CAN NOT MAKE COMPILE Fix this for me :












    package javaapplication1;
    import java.util.Scanner;
    import java.util.ArrayList;
    import java.util.Collections;




    public class Majed203
    {
    public static void main(String[] args);


    Scanner in = new Scanner(System.in);
    ArrayList<Double> numbers = new ArrayList<>();
    double sum =0.0;
    double avg =0.0;
    System.out.println("Enter 10 numbers, New line for each Input.");

    for (int I=0; I<10 ; I++)
    numbers.add(in.next.Double());

    for (int I = numbers.size() -1; I >= 0; I--)

    sum = sum + numbers.getClass(I)
    Object maxRe = Collections.max(numbers);
    Object minRe = Collections.min(numbers);
    avg = sum/10;

    System.out.println("Maximum = " + maxRe);
    System.out.println("Minimum = " + minRe);
    System.out.println("Average = " + avg);
  • Dec 12, 2014, 09:11 AM
    CravenMorhead
    What is the compile error that you got?

    Is this your file or your code? There are some fundemental issues here but I don't know if it is just your formatting or if it your actual code.

  • All times are GMT -7. The time now is 01:21 AM.