0

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BufferedReaderExampl

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BufferedReaderExample public static void main(String[] args) throws IOException { InputStreamReader isr=new inputStreamReader(System.in); BuferredReader br=new BufferedReader(isr); String name,gradeLevel,section; int age; //or integer age; float sd; double dfd; System.out.println("Student Info"); System.out.println("Enter Your Name:"); // read the name user input name=String.valueOf(br.readLine()); System.out.println("Enter Your Age:"); // read the age user input try {age=Integer.valueOf(br.readLine); { Catch (NumberFormatExceptiom); System.out.println("Something went wrong");} // read the wrong user input { System.out.println("Grade Level:");} gradeLevel=String.valueOf(br.readLine()); // read the 11 user input { System.out.println("Section:"); section=String.valueOf(br.readLine()); // read the 3 user input

1st Feb 2022, 11:13 AM
Raine Racuya
1 Réponse
0
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BufferedReaderExample public static void main(String[] args) throws IOException { InputStreamReader isr=new inputStreamReader(System.in); BuferredReader br=new BufferedReader(isr); String name,gradeLevel,section; int age; //or integer age; float sd; double dfd; System.out.println("Student Info"); System.out.println("Enter Your Name:"); // read the name user input name=String.valueOf(br.readLine()); System.out.println("Enter Your Age:"); // read the age user input try {age=Integer.valueOf(br.readLine); { Catch (NumberFormatExceptiom); System.out.println("Something went wrong");} // read the wrong user input { System.out.println("Grade Level:");} gradeLevel=String.valueOf(br.readLine()); // read the 11 user input { System.out.println("Section:"); section=String.valueOf(br.readLine()); // read the 3 user input
1st Feb 2022, 11:13 AM
Raine Racuya