005-002-005

If-Else Statement: Pass or Fail

Easy

Problem Description

If-Else Statement: Pass or Fail

Learning Objective: Learn conditional branching with if-else statement

Overview

Let's create a program that determines pass or fail based on test score. 60 or above is a pass!

Specifications

  • Initialize integer variable score to 75
  • Display "Pass" if 60 or above
  • Display "Fail" if below 60

Output Format

Pass

Test Cases

※ Output examples follow programming industry standards

Input:
Expected Output:
Pass
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
public class Main {
// メインメソッドを定義
public static void main(String[] args) {
// コピー: 値 の 75 into スコア (pass により 値)
int score = 75;
// if スコア は 大きい より または 等しい まで 60をチェック
if (score >= 60) {
System.out.println("Pass");
} else { // 条件が満たされない場合を処理
System.out.println("Fail");
}
}
}

0 B / 5 MB

You have 10 free executions remaining