Suppose that we already have a file which contains the students’ records (See file Student.txt). Each student record includes following information: Fullname, Location, Age in that order. You should write a program to read that file and create another file (named Student_copied.txt) with the contents as follows:
• FullName: Copy and change to uppercase letters in new file.
• Location, Age: Copy exactly the content of old file.
In this exercise, you should specify only file name, don’t specify the path. For
example: new FileWriter("Student_copied.txt").
This is my code:Code:Nguyen Xuan Phuong -------> NGUYEN XUAN PHUONG //uppercase
Hcm Hcm //the same
19 19
Nguyen Van Ngoc NGUYEN VAN NGOC //uppercase
Hcm Hcm//the same
20 20
My code made all lines uppercase butCode:public static void main(String[] args) {
String line;
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("Student.txt"));
PrintWriter print = new PrintWriter(new FileWriter("Student_copied.txt"));
while (true) {
line = bufferedReader.readLine();
if(line == null)
break;
String str = line.toUpperCase();
print.println(str);
}
bufferedReader.close();
print.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
I want to uppercase just the line of name.

