Question
Write a program, Summarize (Summarize.java), containing the main() method, that first writes 10,000 random positive double type numbers, to the full accuracy of the number
Write a program, Summarize(Summarize.java), containing the main() method, that first writes 10,000 random positive double type numbers, to the full accuracy of the number (15/16 decimal places), to a text file named DataValues.txt, one number per line. The program must then close that file, and reopen it for reading. Read back the values from the file and write the following information to a file named Summary.txt:
- Your name;
- The class name and section number;
- The current date/time (i.e., the date when the Summarize program is being runwhich also means that the date/time when the Instructor runs that program should be the date seen);
- The total number of values in the file (which should be exactly the number you generated, but count them anyway);
- The average of the values in the file (i.e., the sum, divided by the count of numbers);
- The largest value in the file; and,
- The smallest value in the file (these last three values being shown to 14/15 decimal places).
Please use as your random number generator a Random class object, declared and initialized as follows:
public static final Random random = new Random(-1L);
and using the method nextDouble to get the actual double values.
You may determine the presentation of the information in the output file, but the end result should be clear and easy to read (see sample below).
There should be three files:
- Summarize.javathe program that writes and then reads the text file of values and prints summary information about those values, plus any other subsidiary Java files that your solution may need;
- DataValues.txtthe file containing the numbers; and,
- Summary.txtthe file containing the summary information.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started