Write Program Samjava Process Text File Use Scanner Read Lines Samtxt Write Code Modify Fi Q43902100
Write the program sam.java to process the text of this file. Usea Scanner to read lines from sam.txt, and write code to modify thefile. Translate all of the odd-numbered lines to all lower case,and all of the even-numbered lines to all upper case, skipping anyempty lines. That is, if the line before a blank line is the lowercase then the next line after the blank should be upper case,regardless of the offset line number. Leave the blank lines in youroutput file so that the formatting of the text remains thesame.
Write your output to a new file called samnew.txt. Use aPrintWriter object to write your translated output to the file.
Expert Answer
Answer to Write the program sam.java to process the text of this file. Use a Scanner to read lines from sam.txt, and write code to…
OR