KISA Prep - Computer Applications 2025
KISA Prep - Computer Applications 2025
General Instructions
Answers to this Paper 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 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 brackets[].
Instruction for the Supervising Examiner
Kindly read aloud the Instructions given above to all the candidates present in the
Examination Hall.
_____________________________________________________________________________
Section A
(Attempt all questions from this section)
Question 1
Choose the correct answers to the questions from the given options. [20]
i. Taking notes
v. Which of the following correctly lists the sizes of primitive data types in Java?
a) byte = 1 byte, short = 2 bytes, int = 4 bytes, long = 8 bytes
b) byte = 2 bytes, short = 4 bytes, int = 8 bytes, long = 16 bytes
c) byte = 1 byte, short = 1 byte, int = 2 bytes, long = 4 bytes
d) byte = 4 bytes, short = 4 bytes, int = 8 bytes, long = 8 bytes
viii. What happens if two case values are identical in a switch statement?
a) Both cases will execute
b) Only the first case will execute
c) Compilation error occurs
d) Default case is executed
ix. Assertion(A): Constructors are used to initialize objects when they are created in Java.
Reasoning(R): A constructor initializes the instance variables of an object when it is created.
a) Both Assertion and Reasoning are true, and Reasoning is the correct explanation of Assertion.
b) Both Assertion and Reasoning are true, but Reasoning is not the correct explanation of
Assertion.
c) Assertion is false, but Reasoning is true.
d) Assertion is true, but Reasoning is false.
xi. Which code snippet will correctly calculate the sum of all elements in a two-dimensional
array arr?
Page 2 of 8
a) int sum = 0;
for (int i = 0; i < arr.length; i++) {
sum += arr[i];
}
b) int sum = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
sum += arr[i][j];
}}
c) int sum = 0;
for (int i = 0; i < arr[0].length; i++) {
sum += arr[i];
}
d) int sum = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i]; j++) {
sum += arr[i][j];
}
}
xiii. What will be the value of z after the given statements ae executed?
int x=7,y=3,z=10;
z+=++x%10 + y++*10 + ++z/10;
a) 12
b) 45
c) 49
d) 52
xiv. Consider the following program segment where the statements are jumbled, choose the
correct order of statements to find the sum of the odd factors of a number.
void sum(int n)
{
sum+=i; 1
for(int i=1;i<=n;i++) 2
{
int sum=0; 3
Page 3 of 8
}
if(n%i==0 && i%2!=0) 4
}
System.out.println("The sum of the odd fators="+sum); 5
a) 4,1,3,2,5
b) 4,2,3,1,2
c) 3,2,1,3,5
d) 3,2,4,1,5
a) Fant
b) anta
c) ant
d) Fan
xix. A method in which the method parameter can get modified is called as ___________
a) Pure method
b) Virtual method
c) Impure method
d)Actual parameters
Page 4 of 8
xx. What is the output of the following code?
int n[]={5,4,3,2,1};
int b=3;
b=n[n[b]/2];
System.out.println(b);
a) 2
b) 4
c) 1
d) 5
Question 2
}
iv. Write the output of the following string methods.
v. How many times will the loop be executed? Write the output of the code. [2]
int a=0,b=1;
for(a=0;a<=20;a+=5,b++)
System.out.println(a+b);
System.out.println(b);
Page 5 of 8
vi. Rewrite the following code using ternary operator. [2]
if (age >= 18)
eligibility = "Adult";
else
eligibility = "Minor";
vii. A student is trying to convert the given string to a numerical value, but gets an error in the
following code. Name the error (syntax/logical/runtime). Give the reason for the error.
String s="356.A8";
double p=Double.parseDouble(s);
char ch=s.charAt(4);
System.out.println(p+ch); [2]
viii. Consider the following program segment and answer the following questions. [2]
int a[][]={{1,2,3},{4,5,6},{7,8,9}};
a. What is position of 5?
b. What is the result of the statement a[0][0]+a[1][2]+a[2][1]
x. Consider the following program segment and answer the questions given below.
class example
{
int a,b;
static int x,y;
void perform()
{ a=10;b=2;
int z=a;
a=b;
b=z;
display();
}
void display()
{
System.out.println("Value of a="+a);
System.out.println("Value of b="+b);
}
}
Page 6 of 8
SECTION B
(Answer any four questions from this Section.)
The answers in this section should consist of the programs in either BlueJ environment or any
program environment with java as the base.
Each program should be written using variable description/mnemonic codes so that the logic of
the program is clearly depicted.
Flowcharts and algorithms are not required.
Buffered Reader / Data Input Stream should not be used in the programs.
Question 3
Fashion Courier Service charges for the parcels of its customers as per the following
specifications.
Class name: FashionCourier
Member variables:
String name: to store the name of the customer
int wt: to store the weight of the parcel in kg
double charge: to store the charge of the parcel
Member methods:
FashionCourier() : default constructor to initialise the member variables with their respective
default initial values.
void accept(): to accept the name of the customer and weight of the parcel.
void compute(): to calculate the charge as per the following criteria.
Weight C Charge
L Less than 5 kgs RRs. 50 per kg
A Above 5 kgs and less than 10 kgs R Rs. 150 per kg
A Above 10 kgs and less than 20 kgs RRs. 200 per kg
AAbove 20 kgs R Rs. 350 per kg
Question 4
Write a program to accept 15 integers in a single dimensional array and perform selection sort
on the integers and print them in ascending order. [15]
Question 5
Write a Java Program to input a string and check it is a palindrome string, a special word or
neither.
A string is called palindrome when the string is read from left to right or from right to left it is
the same string. A string is called special word if it starts and ends with the same character.
Sample Input: madam Sample Output: Palindrome string
Sample Input: comic Sample Output: Special word
Page 7 of 8
Sample Input: cream Sample Output: It is neither a palindrome nor a
special [15]
Question 6
Write a program to accept a number and calculate the norm of the number.
Norm of a number is the square root of the sum of the squares of all digits of the number.
Example: The norm of 68 is 10
6×6 + 8x8 = 36+64= 100
Square root of 100 is 10. [15]
Question 7
Write a program to accept the integer elements of a 2D array of order mxm. Print the elements
in matrix format. Also print the sum of elements of each column.
Example:
Input: Order of the matrix m=3
a[][]={{1,2,3},{3,4,5},{6,7,8}}
Output:
1 1 23 3
3 34 45 5
6 67 78 8
Question 8
@
@ $
@ $ @
@ $ @ $
Page 8 of 8