You are on page 1of 2

SCHOLARS HOME

Duration: 1 Hrs.

1ST COMPARATIVE EXAMINATION 2013-2014


COMPUTER APPLICATIONS
CLASS - X
Maximum Marks: 50

Section A (20 Marks)


(Attempt all the questions from this section)
Question 1

[2 x 5 =10]

a) What is a constructor?
b) int x = 90, y = 40, z;
What is the value of z in
z *= ++x * (y--) y ?
Show the steps.
c) What is the purpose of default in switch statement?
d) What is an object?
e) What are keywords? Give any two examples.
Question 2

[4+2+4=10]

a) Name the following:i)


ii)

Fill in the blanks: InputStreamReader isr = _____ InputStreamReader ( _____________ );


Function of Double class that is used to convert string into double value.

b) Write the output of the following code segment if s = Shashank Srivastava:


public void find(String s)
{
char ch = s.charAt(0);
String sl = s.substring( s.lastIndexOf( ) );
System.out.println( ch + . + s1);
}
c) Write the value of x in the following statements:
i)
ii)

x = Math.round( - 69.4);
x = Math.rint( - 69.4);

iii)
iv)

x = Math.ceil( - 69.4);
x = Math.floor( - 69.4);

Section B (30 Marks)


(Attempt any three 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 descriptions / Mnemonics Codes such that the logic of the program is clearly depicted.

Question 3

[10]

Write a program to read a number and find the product of all its even digits
Question 4

[10]

Write a function that accepts an integer parameter and checks whether it is a prime no. or not.
Page 1 of 2

Question 5

[5+5]

Write two seperate Java functions to display the following patterns:


i).

1
12
123
1234
12345

ii).

SHIKHA
SHIKH
SHIK
SHI
SH
S

Question 6

[10]

Write a Java program to read a string and check whether the given string contains any consecutive
vowels or not. If it contains any two vowels one after the other, print YES else print NO.
Sample input:
Output:

Aarzoo
YES

Sample input:
Output:

Shubhansh
NO

Question 7
[10]
Define a class Employee having the following description:Data members
int pan
String name
double taxincome
double tax

to store personal account number


to store name
to store annual taxable income
to store the tax that is 10% of taxincome

Member Functions:
Employee( )
Employee( )
input( )
display( )

non-parameterised constructor
parameterised constructor
to read PAN number, name and taxincome
calculate tax and display the details of an employee

Write a program to compute the tax according to the given conditions and display the output as per
given format.
Output:
Pan Number
-

Name
-

Tax-income
-

Page 2 of 2

Tax
-