SMS Computer Prelim 2025
SMS Computer Prelim 2025
0ATE 160/2035
OMPUTEn APPEAons
CLANS N
MAHVS if
Ihe time glven at the head eti s aper is the ime allowd or
iing bhe nnene6
this aper is divile into tw teton
Attempt all questione from Sectlon Aad any tou uestons fom Setinn 6
Ihe intended marks for questions o parts of questions a1e given in
babets
SECTION A
(Atempt all questions fron this Sectlon)
Questlon 1
(20)
Choose the corect answers to the questlons from the glven optlons
1) Assetion (A) Metlhod should be called expliitly either with object reference
0f Cas tefeteICe
Reason () Method can be any user defined name
a) lotlh Assertion (A) and Reason () are true and
Reason (0) is a otret
Oxplanatlon of Assertion (A),
b) Both Assertion (A) and Reason (R) are tue and
Keason () is not a
corect explanation of Assertion (A)
) Assetion (^) is true and Reason (R) is false
d) Assetion (A) is false and Reason (R) is true
1
Ternary operator is a
a) logical operator
b) arithmetic operator
c) relational operator
d) conditionaloperator
b) destroyed
c) assigned a value
d) abstracted
7) What will be the output of
a) 0.0
Math.pow3, 0)
b) 1.0
c) 3.0
d) 1.0
8) A method can
return [11
a) any number of values
b) 2 values
c) onty 1 value
d) 3 values
d) 5.0
a) continue
b) break
c) return
d) System.exit(0)
memory as (1]
(A) JVM 0s a ava interDreter loaded in the computer
ASsertion
soon as Java is loade.
platforms.
Reason (R) JVM is different for different
(R) is a correct
Assertion (A) and Reason (R) are true and Reason
a) Both
explanation of Assertion (A).
not a
Both Assertion (A) and Reason (R) are true and Reason (R) is
b)
correct explanation of Assertion (A).
c) Assertion (A) is true and Reason (R) is false.
d) Assertion (A) is false and Reason (R) is true.
a) int
b) boolean
c) char
d) String
a) NDA
b) DAY
c) SUN
d) N
[1]
segment:
loop in the given program
17) State the type of
2)
for (int i 5; i l= 0;
(System.out.println(i):)
a) finite
b) infinite
c) null
d) fixed
method
given to a package, class, interface, [1)
name
Assertion (A) ldentifier is a
18)
or variable. from other
programmer to refer to the item
allows a
Reason (R) ldentifier
places in the program. (R) is a correct
Assertion (A) and Reason (R)are true and Reason
a) Both
explanation of Assertion (A).
is not a
Assertion (A) and Reason (R) are true and Reason (R)
b) Both
Assertion (A).
correct explanation of
Reason (R) is false.
c) Assertion (A) is true and
Reason (R) is true.
d) Assertion (A) is false and
a) X[4]
b) X[5)
X[3)
d) X(0)
class, [1
corresponding object of its
type is converted to a
When primitive data
it is called:
a) Autoboxing
b) Unboxing
[20)
Question 2
are a = 2, b= (2)
the following expressions, if the values of the variables
1) Evaluate
3and c = 3
i. a -(b++) (-c)
ii. a (++b) %c
(xy)/3 [2]
) Write the Java expressions for the following: z = x3 + y3+
Write the java logic to input 10 umbers into an integer array using for loop [2
int m,
in++a|1]:
j=a<2]++,
m=ali++].
System.out.print(i+ "+j+ "+m).
(21
program segment:
the following
7 Give the output of
int n 4279: int d
while(n > 0)
{d=n% 10:
System.out.printin(d);
n =n/ 100:
Section.)
(Answer any four questions from this
environment or
consist of the programs in either Blue
The answers in this section should
environment with java as the base.
any prOgram
variable description so that the logic of
the
Each program should be written using
program is clearly depicted
Flowcharts and algorithms are not required.
Question 3
(15]
description:
Design a class name ShoWRoom with the following
Instance variables /Data members:
Question 4
(15)
Write a program to input a sentence and count the
number of vowels in it.
Question 5
(15)
Desgn a class to overload a function series( ) as follows:
al void series(int x, int n)-To) display the sum of the series given below:
xn terms
Question 6
(15]
fne a class to accept values in integer array of size 10. Sort them in an ascending order
cing selection sort technique. Display the sorted array
Question 7 (15)
knn a class to accept a String and print the number of digits, alphabets and special
characters in the string.
Example:
S= "KAPILDEV@83"
Output:
Number of digits -2
Number of Alphabets-&
Number of Special characters -1
Question8 [15)
Write a program to input two integers and find their Highest Common Factorl(H.C.F).
For Example,
INPUT:
Enter 2 integers:
12
OUTPUT: H.CF. = 4