You are on page 1of 3

http://www.icseguess.

com/

Sample Paper – 2009


Class – X
Subject – Computer Application

Marks : 100 Time : 2 Hrs.

Answer to this paper must be written on the paper provided separately. You will not be allowed
to write during the first 15 minutes. This time is to be spent in reading the question paper. The
time given at the head of this paper is the time allowed for writing answers.
This paper is divided in to two sections. You are to answer all the questions from section A and
any four from section B. The intended marks for the questions are given in the brackets.

Section : A
Attempt all the questions.

1. a. Define Inheritance and give an example. (2)


b. Explain the key word implements and extends. (2)
c. Differentiate between break and continue. (2)
d. What are different forms for declaring a 2-D array. (2)
e. Explain polymorphism with a suitable example. (2)

2. a. Find the value of x after evaluation if initial value of x is 5


(i) x+=x++ + ++x + x-- (ii) x /=x + --x + --x + x (2)
b. Write a statement in Java to do the following if String n =”Mahatma Gandhi”; (2)
(i) To print “atma”
(ii) To print “Gandhi”
c. Write the keyword to convert a string to integer and integer to string. (2)
d. Differentiate between an infinite loop and empty loop. (2)
e. If int a[] = {1,2,3,4,5}; what will be the output? (2)
(i) System.out.println(a.length+10);
(ii)System.out.println(a[0] + a[4] / 5);

3. a. Differentiate between a constructor and method or function.. (2)


b. Differentiate between returnable function and recursive function.. (2)
c. Write the output?
(i). double d = ¾ + 7/8 + 6%9; (1)
(ii) class abcd (2)
{
private int x;
private int y;
void abcd(int a, int b)
{
x = a;
y = b;
}
void display()
{
int z = (x>y)? 3:4;
System.out.println( “Your answer is”+z):
}
void main( int m, int n)
{
abcd s = new abcd(m,n);
s.display();
}} if input is : -9 & 7

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com
http://www.icseguess.com/

(iii) class xclass


{
void sumnum(int m, int n) (1)
{
System.out.println (m+n);
}
void main()
{
sumnum(7,9);
}}
d. Find the errors in the following program segment: (2)
class friendly
{
public int a;
private void friendly(int x)
{
x = a;
}
public void main()
{
system.out.println(a);
}
}
4. a) Differentiate between a syntax error and logical error? (2)
b) If boolean x =true, y = false and z = true what will be the result of the (4)
following program segments.
(i) x !! y &&z
(ii)x&&y &&z
(iii)!x&&!z
(iv) if (y)
System.out.println(“Good”);
else
System.out.println(“Better”);
c) Explain binary and linear search, Which is preferable and why?
d) What is precision . What is the capacity of storing data in data types float and double?

Section B
Attempt any four questions

5. Write a Java class to find out the total pay of n number of employees basic upon the
following criteria: [15]

Member variables:
Name as String, Basicpay as Integer
Methods:
Getdata() – to read the names and basic pay
Calculate()- to calculate total pay
Display() – display the data
Main() – to call all the methods

6. Write a program to check whether a 2-D matrix is an unit matrix? A unit matrix has all the
left diagonal elements are 1 and other elements are 0. [15]

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com
http://www.icseguess.com/

7. Write a program to print the first character of each word in a sentence as capital letter.
Ex: if input is : dayanand anglo vedic output will be: Dayanand Anglo Vedic [15]

8. Write a program to sort the names of the students having two subject marks like Mathematics
and Computer by descending order using Bubble sort method. Print the names of students
who scored highest mark in Mathematics and Computer. [15]

9. a. Write a class to print the following pattern? [7]


*
***
*****
*******

b. Write a class to find out the perimeter of a square, rectangle and circle as per user’s choice.
Use the method: perimeter ()
perimeter of square = 4xside, perimeter of rectangle = 2(l+b) and
perimeter of circle = 2x3.14x R [8]

Paper By : Shri S.K. Nayak


Email Id:- sknayak@ori.nic.in
Telephone No. 9438730691

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

You might also like