Question: 1. Write a program to create a file named integers.dat, overwriting the file if it does exist. Write between 70 to 150 random integers using
1. Write a program to create a file named integers.dat, overwriting the file if it does exist. Write between 70 to 150 random integers using Random. nextInt() (the number of integers determined randomly) to the file using binary 1/O. Print the sum of the integers you've written to the screen. 2. Read back the contents of the integers.dat file that you did in Question 1 and calculate the sum. Make sure the sum you get is the same as what you got for Question 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
