Exercise: Array With Random Numbers

Write a program that

For example:

The array: 5, 6, 5, 10, 3, 7, 6, 8, 3, 2
Sum of all numbers: 55
The largest number is: 10

Hint 💡

When creating random numbers, you only need to initialize the random object once. You can then use the same object to generate random numbers in a loop:
Random random = new Random();
int lowerInclusive = 0;
int upperInclusive = 10;
for (...) {
  int randNr = random.nextInt(lowerInclusive, upperInclusive + 1);
}

Hand in instructions

  1. Make sure your program runs correctly.
  2. Hand in your program by uploading Main.java to Moodle.