004-001-002
If Statement: Pass/Fail Determination
Easy
Problem Description
if statement: Pass/Fail Determination
In this problem, you will create a program that reads a test score, uses an if statement to determine whether it is 60 or higher, and displays pass or fail to standard output.
Learning Objective: Distribute two results with if statement
Determine pass/fail from test score. Pass if 60 or higher, fail if lower.
Input
Line 1: Score (integer)
Output
If 60 or higher:
Score: [score] pts
Pass
If lower than 60:
Score: [score] pts
Fail
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
75
Expected Output:
Score: 75 pts Pass
Normal case
Input:
45
Expected Output:
Score: 45 pts Fail
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 10 free executions remaining
