CSCI-1320 Lab: Arrays #1

Instructor: Todd Dole

Purpose Statement

Arrays are an essential building block in all but the most simple programs. This assignment begins the process of working with arrays.

Instructions

Write a program that will perform the following tasks in the order given:

  1. Ask the user how many random numbers they want to generate (1-100).
  2. Generate the specified number of double values and store them into an array. Use this formula to generate the numbers: Math.random()*1000.0 + 17.5
  3. In a separate loop display all of the generated numbers.
  4. In a separate loop calculate the sum of the numbers and then display the sum and average values.

Submit your homework by uploading your program's .java file through Canvas. You may name the file (and the class) whatever you think is appropriate.