You are on page 1of 5

Guess Paper – 2009

Class – X
Subject – COMPUTER APPLICATIONS (THEORY)

This paper is divided into two sections. You are to answer all questions from Section
A, and any four questions from Section B.The intended marks for questions or parts
of questions are given in brackets[ ]

SECTION A( 40 Marks)

Question 1 [2+2+2+2+2]

(a) Differentiate between Interpreter and Compiler .


(b) What is Recursive Function. Give an example of it.
(c) Mention two characterstic of java ?
(d) What is java API?
(e) Which element is num[99] of the array num?

Question 2 [ 3+2 +3+2]

(a) Write an equivalent Java expressions for the following


expressions :
(i)|a| +b > = |b| + a ii) iii)
(b) What is Constructor overloading . Give an example.
(c) What will be the output for the following program
segment?
int a = 0, b = 30, c = 40;
a + = − −b + ++ c ;
System.out.println("a =" + a);
System.out.println("b =" + b);
System.out.println("c =" + c);

(d) Differentiate between String and StringBuffer objects.

Question 3 [2+4+2+2]
(a) What will be the output of the following code snippet
when combined with suitable declarations and run ?
StringBuffer city = new StringBuffer ("Madras") ;
StringBuffer string = new StringBuffer ( ) ;
string.append(new String(city)) ;
string.insert(0, "Central") ;
System.out.println(string) ;
(b) Rewrite the following if-else statement in terms of
switch-case statements?
char code;
if(code=='A')
System.out.println("Excellent");
else if(code =='B' || code =='C')
System.out.println("Good");
else if(code =='D')
System.out.println("Poor");
(c) What is bytecode?
(d)What do you mean by abstraction?Give an example.

Question 4 [2+2+2+4]
(a) Which of the following will produce a value if x = 22.9
(i) Math.ceil(x) (ii) Math.floor(x)
(b) What do you understand by JVM?
(c) What do you understand by primitive and non-primitive
data type?
(d)
(i) Convert the following segment into equivalent for
loop and do while loop
public void display()
{
int i=10;
while ( i !=0)
{
System.out.print(i +" ");
i-- ;
}
}
ii) Find the output of the following
public void display()
{
int i=1;
while (i!=5)
{
System.out.print(i++ +" ");
i++;
}
}

SECTION B (60 Marks)


Attempt any four questions from this section.
The answers in this Section should consist of the
Program in Bluej environment with Java. Each program should be written using
Variable description / Mnemonic Codes such that the logic of the program is clearly
depiction. Flow charts and algorithms and not required.

5 [15]
Write a program to accept 15 integers from the
keyboard, assuming that no integer entered is a zero.
Enter an element from user and perform binary Search
on the integers array and then print the element and
its index number if it is found else print It is not
present in an array.

6 [15]
An electricity board charges the bill depending on the
number of units consumed as follows
Units charge
First 100 units 40 P per unit
Next 200 units 60 P per unit
Above 300 units Rs 1 per unit
WAP to print charges and the net bill to be paid by a
consumer. The net bill includes a monthly rent of Rs
250.00 charged from a consumer.

7 [15]
Write a program in java to accept two words and check
whether they are Anagram or not.

Anagram: A word that is made with the combination of


the letters present in the original word.

e.g. A word is FLOW and the other word is WOLF which


is formed with the combinations of the letters present
in the original word. Thus , FLOW and WOLF are
Anagrams.

8 [7+8]
(a) Write a java program to print n terms of the
fibonacci series as follows. 0,1,1,2,3,5,8……n terms

(b) Write a program in java to accept a Binary number


(base 2) and Convert it in to its Decimal equivalent
( base 10 )

9 [15]
Define a class employee with the following members to
compute the salary slip of an employee.
Data member : Employee Number(Empno)
Employee Name:(name)
Employee Basic Pay:(salary)
House Rent Allowance(HRA)
Dearness Allowance (DA)
Income Tax deduction (IT)
Gross Pay(GP)
Member function :
1 Parametrized constructor to initialize data member
2 public void calc()
HRA = 10% ofsalary
DA = 55.5% of salary
IT = 6.0% of salary;
GP = salary+HRA+DA-IT;
3 public void display()
10 [15]
Write a menu based program to display the roots of an
quadratic equation (ax2+bx+c=0) as per user choice.

1 If b2-4ac <0 print IMAGINARY ROOTS

2 If b2-4ac > 0 print ROOTS ARE REAL AMD DISTINCT


also print the value of the roots using the
formula root1 = and root2 =
2
3 If b -4ac = 0 , Print EQUAL ROOTS and value
of both roots is root1=root2 =