Mcqs Answers Comp Ganga

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

COMPUTER APPLICATIONS

Maximmum Marks: 100

Time allowed: Two hours

Answers to this Paper mst be written on the paper provided separately.


You willnot beallowed to write during the frst 15 nin°es.
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 the answers.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.

The intended marks for questions or parts of questions are given in bracketsl I
SECTION A (40 Marks)
(Attempt all questions from this Section.)
Questionl [20]
Choose the correct answers to the questions from the given options.
(Donot copy the questions, write the correct answers only.)
(i)
Polygon

Consider the above picture and choose the correct statement from the following:
(a) Polygon is the object and the pictures are classes
(b) Both polygon and the pictures are classes
\er Polygon is the class and the pictures are objects
(d) Both polygon and the pictures are objects
This paper consists of 11 printed pages and 1 blank page.
T24 861 Turn Over
© Copyright reserved.
(i1) int x =98; char clh=(char)x: what is the value in ch?

(b) A

(c) B
(d) 97

(iii) The output of the stalement "CONCENTRATION".indexOf("T) 1s:


(a) 9

(b) 7

(d) (-1)
(iv) The access specifier that gives least accessibility is:
(a) package
(b) public
(c) protected

v private
(v) The output of the statement "talent".compareTo("genius'") is:
(a) 11

(b) -11
(c) 0

d 13
(vi) Which of the following is an escape sequence character in Java?
(a) /n

(c) /t

(d) //n

T24 861 2
(vii) if (a>b&&b>c) then largest number is:
(a) b

(b) c
a

(d) wrong expression


(viii) What is the output of Math.ceil(5.4) +Math.ceil(4.5)?
(a) 10.0

(c) 12.0

(d) 9.0

(ix) What is the method to check whether a character is a letter or digit?


(a) isDigit(char)
(b) isLetterOrDigit()
es isLetterOrDigit(char)
(d) isLETTERorDIGIT(char)
(x) The extension ofa Java source code file is:

(a) exe

(b) obj
(c) jvm
v java
(xi) The number of bytes occupied by a character array of four rows and three
columns are:
(a) 12

t 24
(c) 96

(d) 48

T24 861 3 Turn 0ver


with switch case construct?
(xii) Which of the following data type cannot be sed
(a) int

(b) char

xe String
Lay double

(xiii) Which of the following are entry controlled loops?


1. for

2. while

3. do..while
4 switch

(a) only 1
o 1and 2
(c) 1and 3

(d) 3 and 4

(xiv) Method which reverses a given number is:


ca Impure method
(b) Pure method
(c) Constructor
(d) Destructor

(xv) If the name of the class is


*Yellow", what can be the possible name for its
constructors?

(a) yellow
(b) YELLOW
(c) Yell
a) Yellow

T24 861
4
(xvi) Invoking a method by passing the objects of a class is termed as:
a Callby reference
(b) Callby value
(c) Call by method
(d) Callby constructor

(xvii) The correct statement to create an object named mango of class fruit:
(a) Fruit Mango= new fruit();

oy fruit mango = new fruit(0;


(c) Mango fruit-new Mango0;
(d) fruit mang0= new mango();

(xviii) Assertion (A): Static method can access static and instance variables.

Reason (R): Static variable can be accessed only by static method.


(a) Assertion and Reason both are correct.

(b) Assertion is true and Reason is false.

(c) Assertion is false and Reason is true.


Assertion and Reason both are false.

(xix) What is the output of the Java code given below?

String color []= ("Blue", "Red", "Violet" };


System.out.println(color(2].length):
ay 6

(b)
(c) 3

(d) 2
integer?
an
returns only
(Xx) Which of the following mathematical methods

(a) Math.ceil(n)
(b) Math.sqrt(n)
(c) Math. floor(n)

Math.round(n)

Question 2
(i) Write Java expression for: 21

la + b|
Va' + b2

(i) Evaluate the expression when x is 4: [2)


x+=x++ *++x %2:

(iii) Rewrite the following do while program segment using for: [2]
X= 10; y = 20;
do

X++;

y++;

} while (x<-20);

System.out.println(x *y );
(iv) Give the output of the following
program segment. How many times is the loop
exccuted? [21
for(x=10; x>20;x++)
System.out.println(x):
System.out.println(x*2);

T24 861

You might also like