Question: Writ a Java program that reads numbers entered from the keyboard ( Console ) , determines whether each number is even or odd, and then

Writ a Java program that reads numbers entered from the keyboard (Console), determines whether each number is even or odd, and then writes them to separate files named "even.txt" for even numbers and "odd.txt" for odd numbers. Finally, read from both files and list and count the even and odd numbers to the Console with the proper format.
\table[[Sample Input,Description],[\table[[10],[1154992046377901372249]],The input is from keyboard (Console).],[Sample Output,Description],[\table[[54],[204],[22]],\table[[- The output file for even numbers is in],[Notepad, formatted as a *.txt file],[named "even.txt".],[- The file contains each even number on],[a separate line.]]],[\table[[11],[99],[63],[77],[901],[37],[49]],\table[[- The output file for odd numbers is in],[Notepad, formatted as a *.txt file],[named "odd.txt".],[- The file contains each odd number on a],[separate line.]]],[\table[[Even Number: 5420422],[Total of Even: 3],[Odd Number: 119963779013749],[Total of Odd: 7]],\table[[- Read both "even.txt" and "odd.txt"],[files.],[- List and count the even and odd]
 Writ a Java program that reads numbers entered from the keyboard

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!