Question: JAVA LANGUAGE PLEASE Problem #2: Fun With Files (40 points) Create a Driver program which: Reads in the data from a file called: numbers.txt The

JAVA LANGUAGE PLEASE

Problem #2: Fun With Files (40 points)

Create a Driver program which:

Reads in the data from a file called: numbers.txt The numbers from the file should be stored into an ArrayList... A sample version of this file has been provided, but the one being tested with may have between 1 and 10000 numbers.

Generate 1000 random numbers between 50 and 20000 (50 and 20000 should be included in the range). These numbers should be stored in an array.

Determine the maximum value from the numbers in the ArrayList (must have loop that goes through the ArrayList to examine the values in the ArrayList to receive full credit)

Determine the maximum value from the numbers in the array (must have loop that goes through the array to examine the values in the array to receive full credit)

Print the two max values determined by the code along with the EXACT correct message from below:

If ArrayList has the higher maximum value, print "The largest number is in the file!"

If array has the higher maximum value, print "The largest number was randomly generated!"

If the maximum values are equal, print "The file and the randomly generated data both have the same maximum value!"

Grading Breakdown:

8 -- Reading data into the ArrayList correctly and completely

8 -- Correctly and completely generating numbers in the correct range and storing those numbers in an array

8 -- Correctly and completely using a loop to determine the maximum number in the ArrayList

8 -- Correctly and completely using a loop to determine the maximum number number in the array

8 -- Correctly and completely providing the required output of the program

Here are the numbers:

404 411 329 28 381 114 50 103 342 433 318 189 79 376 346 295 19 469 96 421 197 351 225 62 244 48 310 391 427 313 326 488 434 416 435 407 283 417 319 330 482 338 374 61 480 220 291 452 470 98 71 19 378 57 461 232 374 35 41 311 363 441 456 425 394 16 274 42 41 339 327 160 76 79 394 342 118 489 288 331 377 112 10 208 330 100 383 344 102 407 4 269 10 271 329 49 284 269 137 245

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!