Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /* Phillip Martinez
  4. * Date: 9/23
  5. * Project 4A
  6. * Description: If statements
  7. */
  8. public class Project4A {
  9. public static void main(String[] args)
  10. {
  11. Scanner s = new Scanner(System.in);
  12. System.out.print("Please enter an Exam Score: ");
  13. int in = s.nextInt();
  14. check(in); //print out the grade of the student
  15.  
  16. }
  17.  
  18. public static void check(int input)
  19. {
  20. gra(input);//give me a grade, print out the grade
  21. }
  22.  
  23. public static void gra(int in)
  24. {
  25. String g = "";
  26. if(in >= 90)
  27. g = "A";
  28. if(in < 90 && in >= 80)
  29. g = "B";
  30. if(in<80 && in >=70)
  31. g = "C";
  32. if(in < 70 && in >= 60)
  33. g = "D";
  34. if(in < 60)
  35. g = "F";
  36. System.out.println("This student " +
  37. "revieved a '"+g+ "'.");
  38.  
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement