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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!