Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Prompting the user for Score (Numerical Grade)
- System.out.println("Kindly input Numerical Score: (Enter s to Skip)");
- // reading the input into the line variable of string datatype
- String line = input.nextLine();
- // checking if line =="s" or =="S" to skip, otherwise
- // the value is parsed into a double
- if("s".equals(line) || "S".equals(line))
- {
- }else try
- {
- score = Double.parseDouble(line);
- System.out.println(score);
- } catch( NumberFormatException nfe)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement