003-003-004
Logical Operators: Entry Qualification Check
Easy
Problem Description
Logical Operators: Entry Qualification Check
Learning Objective
Learn how to use logical operators (AND, OR).
Problem
Create a program that checks entry qualification based on age and membership status.
Entry is allowed if 18 or older OR if a member.
Input
Line 1: Age (integer)
Line 2: Member status (1=member, 0=non-member)
Output
Age: [age]
Member: [true/false]
Entry: [true/false].
Test Cases
※ Output examples follow programming industry standards
Input:
20 0
Expected Output:
Age: 20 Member: false Entry: true
Input:
15 1
Expected Output:
Age: 15 Member: true Entry: true
❌ Some tests failed
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
