005-004-001
Discount Eligibility
Easy
Problem Description
In this problem, you will create a program that receives an age as input, uses the || (OR) operator to determine whether the age is 65 or above OR 12 or below, and displays the discount eligibility result to standard output.
Create a program that determines discount eligibility based on age. Use the || (OR) operator to apply discount when age is 65 or above OR 12 or below.
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
70
Expected Output:
Age: 70 years old Discount applied
Normal case
Input:
10
Expected Output:
Age: 10 years old Discount applied
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
