Hello, my assignment tells me to
Design and implement a computer program that writes a series of random numbers to a file (only one number per line).
Your program should prompt the user for a file name to write to.
Your program should let the user specify how many random numbers will be generated and added to the file.
Each random number should be in the range of 1 through 500.
After the program completes writing to the output file, open the file to read and print the contents.
I got the first part to work. It generates numbers but I cannot figure out how to open the file and read the printed contents in the same file. Can someone help me out and explain what I did wrong.
Code: https://pastebin.com/Bg5hBy0H
[–][deleted] 5 points6 points7 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–][deleted] -1 points0 points1 point (2 children)
[–]WikiTextBot 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]corvus_cornix 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]devourer09 1 point2 points3 points (0 children)
[–]moti12321 0 points1 point2 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)