Pass or Fail (Ternary)
Easyjava
Read a mark and print Pass if it is at least 35, otherwise Fail. Use the ternary operator.
Input: one integer — the mark.
Output: one line — Pass or Fail.
Example 1
Input
40
Output
Pass
Example 2
Input
30
Output
Fail
- 0 <= mark <= 100
Hint 1
The condition is mark >= 35.
Hint 2
Assign the ternary result to a String and print it.
One condition, two possible values — the perfect fit for the ternary operator. mark >= 35 selects "Pass", anything else selects "Fail".