005-003-005

Nested if Statements: Grade Evaluation System

Medium

Problem Description

Nested if Statements: Grade Evaluation System

Learning Objective: Understand how to implement complex conditional branching using nested if statements

Overview

Input score and attendance rate, then determine the grade using nested if statements.

Specifications

  • If attendance rate is below 80%: "Attendance insufficient"
  • If attendance rate is 80% or above:
    • Score 90+: "A"
    • Score 70+: "B"
    • Score 50+: "C"
    • Otherwise: "F"

Input

Score and attendance rate (%) are provided

Output Format

Grade: A

Test Cases

※ Output examples follow programming industry standards

Input:
95
85
Expected Output:
Grade: A
Input:
75
90
Expected Output:
Grade: B
Input:
80
70
Expected Output:
Grade: Attendance insufficient
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
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 9 free executions remaining