Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /* Phillip Martinez
- * Date: 9/23
- * Project 4A
- * Description: If statements
- */
- public class Project4A {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- System.out.print("Please enter an Exam Score: ");
- int in = s.nextInt();
- check(in); //print out the grade of the student
- }
- public static void check(int input)
- {
- gra(input);//give me a grade, print out the grade
- }
- public static void gra(int in)
- {
- String g = "";
- if(in >= 90)
- g = "A";
- if(in < 90 && in >= 80)
- g = "B";
- if(in<80 && in >=70)
- g = "C";
- if(in < 70 && in >= 60)
- g = "D";
- if(in < 60)
- g = "F";
- System.out.println("This student " +
- "revieved a '"+g+ "'.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement