You are on page 1of 3

Ajay Chaudhary Classes Private Limited

Ajay Chaudhary Classes


Being Brilliant:-
Computer Test (Full Syllabus) Time: 2 hrs
[Answers 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 mentioned at the head
of this paper is the time allowed for writing the answers.]

SECTION – A
(40 MARKS)
ATTEMPT ALL QUESTIONS FROM THIS SECTION.
Question 1. [2x3]

a) What do you understand by Abstraction? Explain with an example.

b) Name any two packages in the java class library.

c) What do you mean by compound statement? Explain with an example.

Question 2. [2x3]

a) Distinguish between character constant and string constant with an example.

b) Arrange the given data types in descending order of their size: char, long, float, Boolean

c) What do you understand by Literals? Name any one.

Question 3. [2x6]

a) Rewrite the given code using Ternary operator: If( a != b) p = a – b ; Else p = b – a ;

b) What is the difference between: = = and = ?

c) What will be the output of the following, if a=4 , b=2 initially?

1) a* = a % b 2) a+= --a + a++ + a

d) Give the output of the following statements:

1) System.out.print(Math.ceil(-6.25)); 2) System.out.print(Math.Floor(-6.25));

e) Write one similarity and one difference between for loop & while loop.

f) Name the type of errors (syntax,run time or logical) :

1) Division by a variable that contains a value of zero. 2) Missing semicolon.

Computer Test By-Aman Saxena


Ajay Chaudhary Classes Private Limited

SECTION – B
(60 MARKS)
(Attempt any four in this section)
(Each program should be written using variable description)
Question 4.

The International Standard Book Number (ISBN) is a unique numeric book identifier which is printed on every
book.

The ISBN is based upon a 10-digit code. The ISBN is legal if: 1xdigit 1 + 2xdigit2 + 3xdigit3 + …………….+ 10xdigit10 is
divisible by 11

Example: For an ISBN 1401601499

Sum= 1x1 + 2x4 + 3x0 + 4x1 + 5x6 + 6x0 + 7x1 + 8x4 + 9x9 = 253 , which is divisible by 11.

Write a program to:

i) input the ISBN code as a 10-digit integer.

ii) If the ISBN code is not a 10-digit integer, output the message, “Illegal ISBN” and terminate the program.

iii) If the ISBN code is a 10-digit, extract the digits of the code and compute the sum as explained above.

If the sum is divisible by 11, output the message “Legal ISBN”

If the sum is not divisible by 11, output the message “Illegal ISBN

Question 5.

Display the pattern and series:-

 12345
11234
11123
11112
11111

 2+5+10+17+26--------------

Question 6. Write a menu driven program in Java to input a number and check whether it is a: [15]

(a) DISARIUM number or not

(b) DUCK number or not

Note:

Computer Test By-Aman Saxena


Ajay Chaudhary Classes Private Limited

DISARIUM: A number will be called DISARIUM if sum of its digits powered with their respective

position is equal to the original number.

For example 135 is a DISARIUM

(Workings 11+32+53 = 135, some other DI SARI UM are 89, 175, 518 etc)

DUCK: A Duck number is a number which has zeroes present in it, but there should be no

zero present in the beginning of the number.

For example 3210, 7056, 8430709 are all Duck numbers whereas 08237 is not.

Question 7.

Computer Test By-Aman Saxena

You might also like