ICSE Class 10 Computer Application Sample Paper
ICSE Class 10 Computer Application Sample Paper
com
Question 3
(a) State the difference between = and = =. [2]
(b) Write an equivalent Java syntax for the following expression:- a = 0.05 − 2y3 / x − y
[2]
(c) Rewrite the following using Ternary operator
if (income < = 10000 )
tax = 0 ;
else
tax = 12 ; [2]
(d) Write a statement for each of the following:-
i. Store a number 275 as a String
ii. Convert the string to a numeric value
iii. Add it to the existing total of 1000 to update the total. [3]
(e) (i) What is the role of the keyword void in declaring functions?
(ii) If a function contains several return statements, how many of them will be executed?
(iii) Which OOP principle implements function overloading? [3]
(f) What is the output of the following:-
i. System.out.println ("four :" + 4 + 2);
System.out.println (" four : "+(2+2)); [2]
ii. String S1 = "Hi";
String S2 = "Hi"; String S3 = "there";
String S4 = "HI";
System.out.println(S1 + "equals" + S2 + "→" + S1.equals(S2));
System.out.println(S1 + "equals" + S3 + "→" + S1 .equals(S3));
INPUT:
Enter a sentence : the quick brown fox jumps over the lazy dog.
Enter a word to be searched : the
OUTPUT:
Searched word occurs : 2 times. [15]
Question 8
Using a switch statement, write a menu driven program to convert a given temperature
from Fahrenheit to Celsius and vice versa. For an incorrect choice, an appropriate error
message should be displayed. [15]