Comp - 10 - Selection Exam
Comp - 10 - Selection Exam
Selection Examination
2024- 2025
SECTION - A
Attempt All questions.
Question 1: Choose the correct option [1*20=20]
1
This question paper consists of 6 printed sides
(ix) The output of Float.parseFloat("68.75") + 0.5 is:
(a) Error (b) 69.0 (c) 69.25 (d) 68.750.5
(x) What will be the output of the expression:
If a = 14, then b = (++a * (a++ + 5))
(a) 120 (b) 625 (c) 300 (d) 230
(xi) Evaluate double x = Math.pow("COMET".indexOf('M'), 3) +PAPER".compareTo("PEN");
(a) 12.0 (b) -4.0 (c) 8.0 (d) 4.0
(xii) If the class name is Word, which is a valid constructor?
(a) word() (b) Word_Constructor() (c) Word() (d) word_constructor()
(xiii) What value will be stored in variable a?
char ch=’d’;
boolean a=Character.isLetterOrDigit((char)(Character.toUpperCase(ch)-20));
(a) "False" (b) true (c) True (d) false
(xiv) Assertion: Declaring an array of size 5 in Java will create an array with indices 1 to 5.
Reason: In Java, array indices start from 0, so an array of size 5 has indices from 0 to 4.
(a)Both assertion and reason are correct, and the reason is a correct explanation of the assertion.
(b)Both assertion and reason are correct, but the reason is NOT a correct explanation of the
assertion.
(c)The assertion is correct, but the reason is incorrect.
(d)The assertion is incorrect.
(xv) Find out the value of y when String s= "SELECTION EXAMINATION”;
String y= s.substring(s.indexOf(‘E’),s.lastIndexOf(‘E’)-1);
(a) SELECTION (b) CTION (c) ELECTION (d) None of the Above
(xvi) Name the method to convert from String to double datatype.
(a) parseDouble( ) (b) Double.toString( ) (c) Parsedouble( ) (d) ParseDouble( )
(xvii) Identify the concept done in following statements:
int Y=5;
Integer X=new Integer(Y);
System.out.println(X);
(a) Boxing (b) Unboxing (c) Type Casting (d) Coercion
(xix) Assertion: A do-while loop in Java will execute the loop body at least once, even if the
condition is false initially.
Reason: The do-while loop checks its condition at the end of the loop body.
2
This question paper consists of 6 printed sides
(a) Both assertion and reason are correct, and the reason is a correct explanation of the
assertion.
(b) Both assertion and reason are correct, but the reason is NOT a correct explanation of
the assertion.
(c) The assertion is correct, but the reason is incorrect.
(d) The assertion is incorrect.
(xx) int x;
for ( x=l; x<=3; x++ )
System.out.print (x);
System.out.print (x);
Question 2.
3
This question paper consists of 6 printed sides
(vi) Study the following iterative structure and answer the questions with working: [2]
int k = 3;
while(++k<=10)
{
if((k+5) % 5==0)
break;
System.out.println(k+5);
}
(a) How many times will the loop get executed ?
(b) What will be the output ?
SECTION – B
Question 3. [15]
Question 4. [15]
Question 5. [15]
Write a program to accept values in a 4*4 Matrix and Print the Original Matrix and check if the
sum of its right diagonal elements is equal to the sum of Left diagonal elements or not.
Question 6. [15]
Write a program that accepts a sentence as input. Modify the sentence by bringing all vowels of
the word to the beginning, followed by the consonants. Display the new sentence with the modified
words.
Example:
Sample Input: Computer Applications
Sample Output: oueAiaoCmptrpplctns
5
This question paper consists of 6 printed sides
Question 7. [15]
A
B C
D E F
G H I J
K L M N O
void display(int n): To print the sum of the series given below:
Write a program to accept two arrays to store 20 names and their marks. Arrange the marks
using bubble sort technique in descending order. Also display the marks along with
corresponding student name.
EXAMPLE :
Input :
Hari, Anita, Akash, Arpita
80,98,75,88
Output: 98 Anita
88 Arpita
80 Hari
75 Akash
***********************************
6
This question paper consists of 6 printed sides