Professional Documents
Culture Documents
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]
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++;
}
}
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.
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
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.