Computer Half Yearly Paper Solved
Computer Half Yearly Paper Solved
Below are the answers and solutions for the questions visible in the provided
images, solved as per ICSE standards.
---
- **Arrays** ✔️
- **true** ✔️
- **new** ✔️
- **java.lang** ✔️
6. **Give the output of Math.sqrt(x) when x = 9.0**
- **3.0** ✔️
- **import** ✔️
- **Both Assertion (A) and Reason (R) are true and Reason (R) is a correct
explanation of Assertion (A)** ✔️
- **case** ✔️
- **1** ✔️
- **13.0** ✔️
- **JVM** ✔️
14. **State the output of the following: (int)(7.9)**
- **7** ✔️
```java
if(false)
System.out.println("True");
else
System.out.println("False");
```
- **False** ✔️
```java
```
- **0 1 2 3** ✔️
---
---
Given:
```java
int size = 2;
if(size < 0)
System.out.println("Small");
else
System.out.println("Medium");
```
```java
```
---
### **Q2 (iii): Evaluate the following expression when x = 4**
Expression: $$ x * -x + x++ + x $$
- Substitute $$ x = 4 $$:
- $$ x * -x = 4 * -4 = -16 $$
- Next $$ x = 5 $$
**Answer:** `-7`
---
```java
int sum = 0;
sum = sum + k;
System.out.println(sum);
```
- k = 8, 11, 14, 17
- sum = 8 + 11 + 14 + 17 = 50
**Output:** `50`
---
### **Q2 (v): Define a package. State the purpose of two Java packages.**
---
### **Q2 (vi): Write valid statements for the following using Java library
methods**
- `System.out.println(Math.max(45, -50));`
- `System.out.println(Math.pow(10.5, 4.0));`
---
- `{` — Separator
- `==` — Operator
- `2` — Literal
---
### **Q2 (viii): Write the memory capacity (storage size) of the following
data types in bytes**
- float — 4 bytes
- short — 2 bytes
- char — 2 bytes
- byte — 1 byte
---
### **Q3: Program to check for perfect number using sum of factors**
```java
import java.util.Scanner;
int sum = 0;
if(n % i == 0)
sum += i;
if(sum == n)
else
```
---
```java
import java.util.Scanner;
double v = 0;
switch(choice) {
case 1:
System.out.print("Enter l, b, h: ");
v = l * b * h;
break;
case 2:
System.out.print("Enter r, h: ");
double r = sc.nextDouble();
h = sc.nextDouble();
v = Math.PI * r * r * h;
break;
case 3:
System.out.print("Enter r, h: ");
r = sc.nextDouble();
h = sc.nextDouble();
v = (1.0/3) * Math.PI * r * r * h;
break;
default:
System.out.println("Invalid choice!");
return;
}
}
```
---
### **Q5: Class to print sum of series S = x¹ + x² + ... + x²⁰ where x = 2**
```java
int x = 2;
int sum = 0;
```
---
```java
import java.util.Scanner;
int wt = sc.nextInt();
int charges = 0;
if(type == 'O') {
} else {
return;
```
---
### **Q7: Print Fibonacci series up to n terms**
```java
import java.util.Scanner;
int n = sc.nextInt();
int a = 0, b = 1;
int c = a + b;
a = b;
b = c;
```
---
### **Q8: Accept a number, print sum of even and odd factors**
```java
import java.util.Scanner;
int n = sc.nextInt();
if(n % i == 0) {
if(i % 2 == 0)
evenSum += i;
else
oddSum += i;
```
---
[1] 20250522_175326.jpg
https://pplx-res.cloudinary.com/image/upload/v1748096260/user_uploads/
63724093/3483e8f6-2726-4d77-ba99-7b808d6736b3/20250522_175326.jpg
[2] 20250522_175350.jpg
https://pplx-res.cloudinary.com/image/upload/v1748096259/user_uploads/
63724093/a5fbdba6-931e-4d97-879c-442a6cb506b9/20250522_175350.jpg
[3] 20250522_175408.jpg
https://pplx-res.cloudinary.com/image/upload/v1748096259/user_uploads/
63724093/844c6a8e-635d-4dac-b859-6d7e9a65ff23/20250522_175408.jpg
[4] 20250522_175419.jpg
https://pplx-res.cloudinary.com/image/upload/v1748096259/user_uploads/
63724093/855bc2c5-e215-4c8c-bc13-8f7775b8d00d/20250522_175419.jpg
[5] Solutions for Class 10 ICSE Logix Kips Computer Applications with ...
https://www.knowledgeboat.com/learn/class-10-logix-icse-computer-
applications-java-bluej/content
[9] Avichal solutions for Computer Applications [English] Class 10 ICSE ...
https://www.shaalaa.com/textbook-solutions/c/avichal-solutions-computer-
applications-english-class-10-icse-chapter-1.5-introduction-to-java_8232
[13] ICSE Class X Important java question and answer - The Bawal
https://thebawal.wordpress.com/study-material-2/icse-class-x-important-java-
question-and-answer/