/************************************************** ****************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
************************************************** *****************************/
// 1b - Diving Scores
import java.util.Scanner;
public class Main
{
public static Double[] create_input(int N)
{
//Create an array of size N => number of random numbers to be generated
Double[] input_array = new Double[N];
Double b;
// Scanner myObj2 = new Scanner (System.in); // Create a Scanner object
// b=myObj2.nextDouble ();
//generate random numbers and assign to array
for (int i = 0; i < input_array.length; i++)
{
Scanner myObj2 = new Scanner (System.in); // Create a Scanner object
System.out.println ("Please input the scores");
Double input_array[i] = myObj2.nextDouble ();
}
//return array of random numbers
return input_array;
}
public static void main (String[]args)
{
//ArrayList<Double> scores = { 0.0,0.0,0.0,0.0,0.0,0.0,0.0 };
System.out.println ("Diving Scores Calculator ");
//divername = input("Please input the name of the diver ?")
Scanner myObj = new Scanner (System.in); // Create a Scanner object
System.out.print ("Please input the name of the diver ?");
String userName = myObj.nextLine (); // Read user input
//System.out.println("Username is: " + userName);
Main.java:39: error: ']' expected
Double input_array[i] = myObj2.nextDouble ();
^
Main.java:39: error: ';' expected
Double input_array[i] = myObj2.nextDouble ();
^
}
}