Question: Do two of the three labs ( Java Programming / JAVA PROGRAMMING ) Create an application which generates 2 0 random numbers between 1 and

Do two of the three labs (Java Programming / JAVA PROGRAMMING)
Create an application which generates 20 random numbers between 1 and 100 and writes them to a text file on separate lines. Then the program should read the numbers from the file, calculate the average of the numbers, and display this to the screen.
Modify any of the previous labs which would have crashed when non-numeric data was entered by adding exception handling so that the non-numeric input no longer crashes the program. The program must handle the invalid input gracefully by informing the user of the bad input and re-querying until the user provides valid input. It must re-query for the specific input which was incorrectly entered.
Write a recursive method which takes an integer number and returns the sum of the numbers from 1 to that number. The method must solve the problem recursively. Then write an application which calls the method with a few different numbers and displays the return value of the method.

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!