Question: Write Java code that does the following Ask the user to enter a file name. Ask the user for two integers as the lower bound
Write Java code that does the following
Ask the user to enter a file name.
Ask the user for two integers as the lower bound and the upper bound.
Use a loop to write all the odd numbers between the lower bound and the upper bound (inclusive) to the file, and then close the file.
Use either while loop, do while loop, or for loop to complete the program.
PrintWriter class is used.
The file is closed before the program terminates.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
