Implement the following flow chart in Java. The menu should contain the followin
ID: 3786858 • Letter: I
Question
Implement the following flow chart in Java.
The menu should contain the following options:
1) Capitalize all words
2) Lowercase all words
Sample Session
This is an example run of the program. The input and output files are shown after the code.
Please enter the input data file name:
input.txt
Please enter the output data file name:
Output.txt
Choose an option:
(A) Capitalize all words
(B) Lowercase all words
A
Process another file?
Y
Please enter the input data file name:
input.txt
Please enter the output data file name:
output2.txt
Choose an option:
(A) Capitalize all words
(B) Lowercase all words
B
Process another file?
n
Process finished with exit code 0
Output from session
Input file:
line One
linE two
Line Three
Output file for option A:
LINE ONE
LINE TWO
LINE THREE
Output file for option B:
line one
line two
line three
Explanation / Answer
import java.util.
public class JavaProgram01
{
public static void main(String[] args)
{
char ch1;
int temp1;
//scanner class
Scanner scan = new Scanner(System.in);
System.out.print("Enter a Character in Lowercase latters : ");
ch 1= scan.next().charAt(0);
temp1 = (int) ch1;
temp 1= temp1 - 32;
ch1 = (char1) temp1;
System.out.print("Equivalent Character in Uppercase later = " +ch1);
}
}