ICSE class ix computer practice test 3
ICSE Class 9 computer practice test 3: ICSE Class 9 Computer Applications practice test with important questions to revise before the computer exam.
ICSE class ix computer practice test
Oops concepts
1.Convert the following code from if….else to switch …case
if(val==50)
System.out.println(“Fifty”);
else if(val==20)
System.out.println(“twenty”);
else
System.out.println(“Enter a valid number”);
2. Convert the following code from ternary to if…else.
String result= (marks>35)? “pass”: “fail”;
3. Write a program to ask user to enter any number from 1 to 3.
- display a message “Hello” if a particular value is equal to 1.
- display a message “Hi” if a particular value is equal to 2.
- display a message “Good” if a particular value is equal to 3.
- display a message “No Match Found” if none of the above conditions are matching. (Use switch-case only)
4. Write a program to print the following series
a. 1 3 5 7 9
b. 5 10 15 20 25
Watch Java videos
Related Posts
Continue learning with these related articles
Sum of First n Natural Numbers in Java (Loop and Formula)
Find the sum of the first n natural numbers in Java with a for loop, a while loop and the formula n(n + 1)/2, with a dry run and the sums of even numbers, odd numbers, squares and cubes.
Prime Number Program in Java: Check a Number and Print Primes in a Range
Check whether a number is prime in Java by counting its factors, a faster square-root method with isPrime(), and a program that prints all prime numbers in a range.

Encapsulation, Access Specifiers and Scope of Variables in Java for ICSE Class 10
ICSE Class 10 Computer Applications notes on encapsulation: private, default, protected and public access, data hiding with getter and setter methods, instance vs static (class) variables, local variables and scope, with a solved BankAccount program.