Explore BrainMass
Share

Java: writing and reading numbers in/from binary file

This content was STOLEN from BrainMass.com - View the original, and get the solution, here!

Write a program to generate 20 random numbers between 1 and 50, write them to a binary file and then read the numbers back from the file to display them on the screen along with the frequency of occurrence of each number in a nice format. Use the Random class in the java.util package for random number generation.

Please go through the scan of requirement, and the program in attachments.

What I need is the help with part of "along with the frequency of occurrence of each number in a nice format" that means if there is repeated number it should indicate it by showing the frequency of it.

© BrainMass Inc. brainmass.com September 25, 2018, 5:15 pm ad1c9bdddf - https://brainmass.com/computer-science/random-number-generation/281680

Attachments

Solution Preview

Please find the modified file Program6.java attached as 281680.java, that meets the frequency requirement.

An example run with the modified file.

Random numbers ...

$2.19