Created
June 23, 2016 06:03
-
-
Save BenjaminLu/0324cf33e0c22536540b2e18e4844581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (true) { | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
try { | |
System.out.print("Enter Mid exam score : "); | |
double midScore = Double.parseDouble(br.readLine()); | |
System.out.print("Enter roll call score : "); | |
double rollCall = Double.parseDouble(br.readLine()); | |
System.out.print("Enter final exam score : "); | |
double finalScore = Double.parseDouble(br.readLine()); | |
double total = midScore * 0.3 + rollCall * 0.3 + finalScore * 0.4; | |
System.out.println(total); | |
} catch (NumberFormatException nfe) { | |
System.err.println("Invalid Format!"); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment