Users must be above 10 years to open a self-operated bank account. Write this logic using a ternary operator and store the result (the eligibility message) in a…

ICSE Class 10 Computer Applications PYQ · 2026 Paper · Section A

2(iv)1 Mark · 2026 · Section A · 2026 Paper

Users must be above 10 years to open a self-operated bank account. Write this logic using a ternary operator and store the result (the eligibility message) in a String variable named idStatus and print it.

Show SolutionHide Solution↓
String idStatus = (age > 10) ? "Eligible" : "Not Eligible";
System.out.println(idStatus);
← Previous questionNext question →

Browse the free Computer Applications sample bank