Homework #16 (Due: Fri 20 Mar)

Arrays are an essential building blocks in all but the most simp...
...e process of working with arrays
to accomplish a variety of tasks.

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 in the usual fashion by sending it to cscihomework@hsutx.edu with the subject line ``P1 HW #16''.


Quick Links