AOASS Selection
AOASS Selection
Selection Examination
2023- 2024
SECTION -A
Attempt All questions.
Question 1. |20*1-20]
() false
(viii) Assertion: Dcclaring an array of síze 5 in Java will crcatc an array with indices 1 to 5.
Reason: In Java, array indices start from 0, so an array of size 5has indices from0 to 4.
(a) Both asscrtion and reason arc correct, and the reason is a correct
cxplanation of the assertion.
(b) Both assertion and reason arc correct, but the reason is NOT a correct
explanation of the assertion,
-(c) Thc assertion is correct, but the reason is incorrect.
- (d) The assertion is incorrect,
2
This question paper consists of 8 printed sides
(xi) Asserion: Ado-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.
asserionand 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 acorrect explanaton of
the assertion.
(c) The assertion is correct, but the reason is incorrect.
(d) The assertion is incorrect.
(Xi1) Which of the following options correctly represents avalid constant or value in the Java
programming language?
A. "Hello, World!"
B. 3.14.2
C.true
D. '3.2"
(a) Only A
b) OnlyC
(c) A and D
(d) A and C
(xiv) Which of the followingfunctions is used to remove leading and trailing white spaces
from the string?
{a) trail()
(b) trim()
(c) truncate( )
-(d) slice()
{a) true
(b) false
"(c) Hello == Hello
"(d) Nonc of the Above
(xx) int x;
for (x=1; x<=3; x++ )
System.out.print (x);
System.out.print (x);
-(a) 123
(b) 1
·(c) 1234
(d) 1233
Question 2.
4
This question paper consists of 8 printed sides
0.05-2y'
X-Y
(iu) Write a prototype of the method ShowWiz) which receives a double and an integer
as arguments and returns true or false. (2]
(vi) Find the errors in the given program segment and re-write the statements correctly to
assign values to an integer array. (2]
int a =new int (5);
for (int i = 0; i<= 5; itt)
a [i] = i;
5
This question paper consists of 8printed sides
statements instead of the
using nested if-else
segment 121
(ix) Rewrite the following program
ternary operator:
(mark>=90) ? A": (mark>=80) ? "B": "C";
String grade=
2]
and y below ?
What are the final values stored in variable x
(x)
double a=-6.35;
double b = 14.74;
double x = Math.abs(Math.ceil(a));
double y = Math.round (Math max (x,b));
SECTION -B
Section.
Attempt anyfourquestionsfrom this
J environment or any
answers in this Section should consist of thePrograms in either Blue
The as the base.
program environment with Java
Next 10 km Rs 8/ km
Next 10 km Rs 6/ km
More than 30 km Rs. 5/ km
6
This question paper consists of 8 printed sides
void display( ): To
passcnger. dispiay the details such as name, km travelled and the total fare of the
Write a main( )
method to create an object of the class and call the above member methods.
Question 5.
|151
Wite a program to input 20 number of String elements in an
order using bubble sort technique array and sort them in descenaing
and print the sorted list.
Question 6. |15]
Write a program to input a number and check and nrint whether it is an
EvenPal number or iot.
The number is said to be an EvenPal number when the number is a
sum of its digits is an even number. palindrome number and ne
Example:
Number 121 is a palindrome number and the sum of its digits is 1+2+1=4, which is
an even number.
Question 7. [15]
Wite a program to accept values in a4*4 Matrix and Print the Original Matrix and the sum of its
right diagonal elements.
Question 8. [15]
Define a class to overload the method display as follows:
void display(): To print the following format using nested loop
1111
3333
5555
7777
void display(int n): Toprint the cube of each digit of the given number
Example: n= 4329
Output - 64
27
729
Define a class to declare an array to accept and store ten words. Display only those words
which begin with the letter'A' or 'a' and also end with the letter 'A' or 'a'.
EXAMPLE:
Input : Hari, Anita, Akash, Arpita, Alina, Devi Rishab, John, Farha, AMITHA
Output: Anita
Arpita
Alina
AMITHA