KISA ICSE Computer Applications- AK
KISA ICSE Computer Applications- AK
KISA ICSE Computer Applications- AK
Question 1
i. 1
d) Polymorphism
ii. b) Java Virtual Machine (JVM)
iii. b)Within the same package and by subclasses 1
vi. 25.0 1
vii. b) Removes spaces at the beginning and end of a string 1
ix. a) Both Assertion and Reasoning are true, and Reasoning is the correct 1
explanation of Assertion.
xiii. c) 49 1
xiv.
d) 3,2 d) 3,2,4,1,5 1
xv.
b) anta 1
xvi. a)final 1
xvii.
a) import d) Defining a constructor with a return type. 1
xviii. a) import 1
xix
c) Impu
c) Impure method
xx b) 4 1
Question 2
i. 27 2
ii. Math.cbrt(Math.pow((a+b),4)/Math.pow(a,2)) 2
iii. Statement with error- if(i%2==0) 2
break;
Replace break with continue
iv. a. miniart 2
b.-4
v. The loop will be executed 5 times. The output of the code is as follows. 2
1
7
13
19
25
6
vi. String eligibility=(age>=18)?”Adult”:”Minor”; 2
vii. Runtime error. These functions cannot be performed on alpha numeric 2
strings
viii. a. Position of 5 is a[1][1] 2
b. 15
ix. a. e 2
b. 89
x. a. Value of a=2 and b=10. 2
b. Class variables x and y
Question 3
int sumOfSquares = 0;
// Loop to extract each digit and calculate the sum of squares of the
digits
while (number > 0) {
int digit = number % 10; // Extract the last digit
sumOfSquares += digit * digit; // Add the square of the digit to
sum
number /= 10; // Remove the last digit
}
}
}
Question 7 import java.util.Scanner;
// Method 2: Print the sum of the given series a/1 + a/2 + ... n terms
void result(int a, int n) {
double sum = 0.0;
for (int i = 1; i <= n; i++) {
sum += (double) a / i; // Add each term of the series
}
System.out.printf("The sum of the series is: %.2f\n", sum);
}
// Main method
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
OverloadResult obj = new OverloadResult();
// Call the first result() method
obj.result();