Reference no: EM132197941
Write a console program that:
Uses a while loop to perform the following steps:
1. Prompt the user to input two integers: firstNum and secondNum where secondNum is at least 10 greater than firstNum, both numbers are positive integers, and secondNum is less than 1000.
2. Verify that the user entered acceptable numbers, and if not, provide error feedback and prompt them again.
3. Output all results to a file in the same directory as the program, placing an appropriate label between each section of output. Note that your program must be able to run repeatedly overwriting the file from the previous run.
4. Output all odd numbers between firstNum and secondNum inclusive, one number per line.
5. Output the sum of all numbers between firstNum and secondNum exclusive.
Uses a for loop to perform the following steps:
1. Continue writing to the same file as before.
2. Write a label as before.
3. Output all numbers from secondNum to firstNum in a single line with commas separating the numbers.
Write the date and time as the last line in the file in the format
yyyy-mm-dd hh:mm:ss.
Must have .JAVA and .Class in notepad function.