ICSE Computer Application - Class X - 2023 PYQ
Table of Content:
- Question 1: Write the Java expression for \[ (a + b)^x \]
- Question 2:
Name the following:
(a) What is an instance of the class called?
(b) The method which has same name as that of the class name.
- Question 3:
Consider the given array and answer the questions given below:
int x[ ] = {4, 7, 9, 66, 72, 0, 16};
(a) What is the length of the array?
(b) What is the value in x[4]?
- Question 4:
Give the output of the following String class methods:
(a) "COMMENCEMENT".lastIndexOf('M')
(b) "devote".compareTo("DEVOTE")
- Question 5: Give the output of the following program segment:
int n = 4279; int d; while(n > 0) { d = n % 10; System.out.println(d); n = n / 100; } - Question 6: Rewrite the following code using the if-else statement:
int m = 400; double ch = (m>300) ? (m / 10.0) * 2 : (m / 20.0) - 2; - Question 7:
Give the output of the following Character class methods:
(a) Character.toUpperCase ('a')
(b) Character.isLetterOrDigit('#')
- Question 8: Convert the following do…while loop to for loop:
int x = 10; do { x––; System.out.print(x); } - Question 9: Evaluate the expression when the value of x = 4: \[ x *= --x + x++ + x \]
- Question 10:
Write the value of n after execution:
char ch ='d'; int n = ch + 5;
Related Questions
- Assignment 1: Design a class with the following specifications:
- Assignment 2: Define a class to accept 10 characters from a user. Using bubble sort technique arrange them in ascending order. Display the sorted array and original array.
- Assignment 3:
Define a class to overload the function print as follows:
void print() - to print the following format
1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5void print(int n) - To check whether the number is a lead number. A lead number is the one whose sum of even digits are equal to sum of odd digits.
e.g. 3669
odd digits sum = 3 + 9 = 12
even digits sum = 6 + 6 = 12
3669 is a lead number. - Assignment 4:
Define a class to accept a String and print the number of digits, alphabets and special characters in the string.
Example:
S = "KAPILDEV@83"
Output:
Number of digits – 2
Number of Alphabets – 8
Number of Special characters – 1 - Assignment 5: Define a class to accept values into an array of double data type of size 20. Accept a double value from user and search in the array using linear search method. If value is found display message "Found" with its position where it is present in the array. Otherwise display message "not found".
- Assignment 6:
Define a class to accept values in integer array of size 10. Find sum of one digit number and sum of two digit numbers entered. Display them separately.
Example:
Input: a[ ] = {2, 12, 4, 9, 18, 25, 3, 32, 20, 1}
Output:
Sum of one digit numbers : 2 + 4 + 9 + 3 + 1 = 19
Sum of two digit numbers : 12 + 18 + 25 + 32 + 20 = 107