2013 Question Paper ICSE Class 10 Computer Applications
2013 Question Paper ICSE Class 10 Computer Applications
Section A
Question 1
Answer
Precedence of operators refers to the order in which the operators are applied to the operands
in an expression.
Answer
Literals are data items that are fixed data values. Java provides different types of literals like:
1. Integer Literals
2. Floating-Point Literals
3. Boolean Literals
4. Character Literals
5. String Literals
6. null Literal
Answer
1. Inheritance
2. Abstraction
Answer
Constructor has the same name as class name whereas function should have a different name
than class name.
(e) What are the types of casting shown by the following examples?
1. double x = 15.2;
int y = (int) x;
2. int x = 12;
long y = x;
Answer
Question 2
Answer
1. Integer
2. Character
(b) What is the difference between a break statement and a continue statement when
they occur in a loop?
Answer
When the break statement gets executed, it terminates its loop completely and control reaches
to the statement immediately following the loop. The continue statement terminates only the
current iteration of the loop by skipping rest of the statements in the body of the loop.
(c) Write statements to show how finding the length of a character array char[] differs
from finding the length of a String object str.
Answer
1. void
2. this
Answer
An exception is an abnormal condition that arises in a code sequence at run time. Exceptions
indicate to a calling method that an abnormal condition has occurred.
Question 3
Answer
String s1 = "good";
String s2 = "world matters";
String str1 = s2.substring(5).replace('t', 'n');
String str2 = s1.concat(str1);
Answer
Value stored in str1 is " manners" and str2 is "good manners". (Note that str1 begins with a
space.)
Explanation
s2.substring(5) gives a substring from index 5 till the end of the string which is " matters".
The replace method replaces all 't' in " matters" with 'n' giving " manners". s1.concat(str1)
joins together "good" and " manners" so "good manners" is stored in str2.
Answer
(d) Rewrite the following program segment using the if..else statement:
int x = 2, y = 50;
do{
++x;
y -= x++;
}while(x <= 10);
return y;
Answer
The loop will run 5 times and the value returned is 15.
(f) What is the data type that the following library functions return?
1. isWhitespace(char ch)
2. Math.random()
Answer
1. boolean
2. double
ut + \dfrac{1}{2}ft^2ut+21ft2
Answer
u * t + 1 / 2.0 * f * t * t
(h) If int n[] = {1, 2, 3, 5, 7, 9, 13, 16}, what are the values of x and y?
x = Math.pow(n[4], n[2]);
y = Math.sqrt(n[5] + n[7]);
Answer
x = Math.pow(n[4], n[2]);
⇒ x = Math.pow(7, 3);
⇒ x = 343.0;
y = Math.sqrt(n[5] + n[7]);
⇒ y = Math.sqrt(9 + 16);
⇒ y = Math.sqrt(25);
⇒ y = 5.0;
(i) What is the final value of ctr when the iteration process given below, executes?
int ctr = 0;
for(int i = 1; i <= 5; i++)
for(int j = 1; j <= 5; j += 2)
++ctr;
Answer
The outer loop executes 5 times. For each iteration of outer loop, the inner loop executes 3
times. So the statement ++ctr; is executed a total of 5 x 3 = 15 times.
Answer
1. nextInt()
2. nextLine()