0% found this document useful (0 votes)
60 views5 pages

2013 Question Paper ICSE Class 10 Computer Applications

The document contains a 2013 question paper for the ICSE Class 10 Computer Applications exam. It includes 10 multiple choice and short answer questions that assess concepts like operators, literals, inheritance, abstraction, constructors vs methods, loops, arrays, and methods of the Scanner class. The questions cover basic Java programming concepts and syntax.

Uploaded by

l8627352
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views5 pages

2013 Question Paper ICSE Class 10 Computer Applications

The document contains a 2013 question paper for the ICSE Class 10 Computer Applications exam. It includes 10 multiple choice and short answer questions that assess concepts like operators, literals, inheritance, abstraction, constructors vs methods, loops, arrays, and methods of the Scanner class. The questions cover basic Java programming concepts and syntax.

Uploaded by

l8627352
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

2013 Question Paper ICSE Class 10 Computer Applications

Section A

Question 1

(a) What is meant by precedence of operators?

Answer

Precedence of operators refers to the order in which the operators are applied to the operands
in an expression.

(b) What is a literal?

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

(c) State the Java concept that is implemented through:

1. a superclass and a subclass.


2. the act of representing essential features without including background details.

Answer

1. Inheritance
2. Abstraction

(d) Give a difference between a constructor and a method.

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

1. Explicit Type Casting


2. Implicit Type Casting

Question 2

(a) Name any two wrapper classes.

Answer

Two wrapper classes are:

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

Java code snippet to find length of character array:

char ch[] = {'x', 'y', 'z'};


int len = ch.length
Java code snippet to find length of String object str:

String str = "Test";


int len = str.length();
(d) Name the Java keyword that:

1. indicates that a method has no return type.


2. stores the address of the currently-calling object.
Answer

1. void
2. this

(e) What is an exception?

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

(a) Write a Java statement to create an object mp4 of class Digital.

Answer

Digital MP4 = new Digital();


(b) State the values stored in the variables str1 and str2:

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.

(c) What does a class encapsulate?

Answer

A class encapsulates data and behavior.

(d) Rewrite the following program segment using the if..else statement:

comm = (sale > 15000)? sale * 5 / 100 : 0;


Answer

if(sale > 15000)


comm = sale * 5 / 100;
else
comm = 0;
(e) How many times will the following loop execute? What value will be returned?

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

(g) Write a Java expression for:

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 final value of ctr is 15.

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.

(j) Name the method of Scanner class that:

1. is used to input an integer data from the standard input stream.


2. is used to input a String data from the standard input stream.

Answer

1. nextInt()
2. nextLine()

You might also like