Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please show final output display. Objective: Text File I/0 and Regular Expressio

ID: 3736303 • Letter: P

Question

Please show final output display.

Objective: Text File I/0 and Regular Expressions Note that both classes below should handle all exceptions that might be thrown within them. 1. Create a class that does the following: a. Reads the name of a file to create as the first command line argument. (Overwrite any file with the same name). b. Reads an integer value as the second command line argument. C. The program should generate as many random numbers as are specified in the second command line argument (from step b) with magnitudes between 1 and 1000 (both inclusive) and write them to the file. Use a seed of 152 for your random number generator. d. You must write only 5 numbers on each line and then begin a new line. (The last line may have less than 5 numbers.) Delimit the numbers on a line with the & character. The end of a line should be delimited by the # character. No other delimiters should be explicitly used. A sample output file for 12 numbers might look like this: 19834&4&235&6# 1278524840085&611# 55&2# 2. Create a second class that does the following: a. Reads the name of the file to open as a command line argument. (Check for incorrect usage). b. Reads in all of the numbers from that file using a Scanner. (Assume a file format identical to the file created in (1) and make sure you use regular expressions to specify the delimiter.) c. Displays, to the standard output, the count and average of all of those numbers.

Explanation / Answer

OUTPUT FROM FILE :

=================

Enter file name : test.txt
Enter Number Count : 12

import java.io.File;

OUTPUT :

Enter file name : test.txt

COUNT = 12
AVERAGE = 664.0833

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote