Write a program that reads a stream of integers from a file and writes only the positive numbers to a second file. The user should be prompted to enter the names of both the input file and output file in main (), and then main () should attempt to open both files (providing an error if there is an error during this process). The main () method should then call the process () method to read all the integers from the input file and write only the positive integers to the output file. The process () method takes as arguments a Scanner to read from the input and a PrintWriter to write to the output. You can assume that if you are able to successfully open the input file, then there will only be integers in it.
+1
Answers (1)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program that reads a stream of integers from a file and writes only the positive numbers to a second file. The user should be ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.