Question: 18.2: Number of Numbers [(JAVA, ECLIPSE), Please keep the program as short as possible] For this assignment you will be working with arrays. Open a

18.2: Number of Numbers

[(JAVA, ECLIPSE), Please keep the program as short as possible]

  • For this assignment you will be working with arrays.
  • Open a new Java project called Nums
  • Prompt a user to enter in the length of the array (the number of numbers).

Enter the number of numbers:

  • Use this information to declare an array of the user-specified length.
  • Next, using a for loop, prompt the user to enter that many numbers, and store each one in your array until your array is at full capacity.
  • Using the same, or a second, for loop, sum the numbers and report their sum to the user.
  • Also, multiply the numbers together and report their product to the user.
  • The sum and the product should be printed to one decimal value only.
  • Your program should work identically to the sample output below:

Enter the number of numbers: 4 Enter 4 numbers: Number 1: 3.2 Number 2: 6.7 Number 3: 2.9 Number 4: 4.6 The sum of the numbers is: 17.4 And the product is: 286.0

  • Another run of the program might give the following output:

Enter the number of numbers: 8 Enter 8 numbers: Number 1: 2.1 Number 2: -5.6 Number 3: 9.0 Number 4: 8.7 Number 5: -2.2 Number 6: 8.2 Number 7: 9.5 Number 8: 1.4 The sum of the numbers is: 31.1 And the product is: 220931.3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!