icjecapu12
icjecapu12
Sample Paper 12
ICSE Class X 2024-25
COMPUTER APPLICATIONS
Time: 2 Hours Max. Marks: 100
General Instructions :
1. Answers to this Paper must be written on the paper provided separately.
2. You will not be allowed to write during the first 15 minutes.
3. This time is to be spent in reading the question paper.
4. The time given at the head of this Paper is the time allowed for writing the answers.
5. This Paper is divided into two Sections.
6. Attempt all questions from Section A and any four questions from Section B.
7. The intended marks for questions or parts of questions are given in brackets [ ].
SECTION A
Attempt all questions from this part.
QUESTION 1.
Choose the correct answer and write the correct option.
(Do not copy the question, write the correct answers only.)
{
char chars[] = {‘x’, ‘y’, ‘z’};
String s = new String(chars);
System.out.println(s);
}
}
(a) xy (b) yz
(c) zx (d) xyz
(ix) Which of these methods of class string is used to check whether a given object starts with a particular string
literal?
(a) ends() (b) endsWith()
(c) starts() (d) startsWith()
(xi) Which access specifier should be used for a class to allow it to be inherited by a subclass?
(a) Public (b) Private
(c) Protected (d) None of these
(xii) What is the term for a class’s ability to inherit (or derive) the properties of another class, either fully or
partially?
(a) polymorphism (b) encapsulation
(c) inheritance (d) data abstraction
(xvii) Assertion (A) : Jump statements can be used to modify the behaviour of conditional and iterative statements.
Reason (R) : When the break statement is encountered, the next iteration starts and the remaining
statements in the present iteration are skipped.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is correct explanation of Assertion (A).
(b) Both Assertion (A) and Reason (R) are true but Reason (R) is not correct explanation of Assertion (A).
(c) Assertion (A) is true and Reason (R) is false.
(d) Assertion (A) is false and Reason (R) is true.
(xviii) Read the following text and choose the correct answer.
Encapsulation is a technique that involves bundling data and methods together within a single unit. In Java,
this concept is applied by utilizing private and protected access modifiers, which restrict access to the data
within a class. This approach ensures that data remains secure and can only be modified through specified
methods, promoting controlled interaction and protecting the integrity of the information stored within the
object.
What is an encapsulation?
(a) Encapsulation is more about ‘How’ to achieve that functionality.
(b) Encapsulation is more about ‘What’ a class can do.
(c) It hides the unnecessary details of the object.
(d) Encapsulation focuses on the outside view of an object.
(xix) Assertion (A) : Pure functions define a relationship between input and output.
Reason (R) : Pure function does not depend on any state beyond its local scope.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion
(A).
(c) Assertion (A) is true and Reason (R) is false.
(d) Assertion (A) is false and Reason (R) is true.
QUESTION 2.
(iii) Write the value that will be stored in variable num after execution of following code.
int num = 0;
for(int j=10; j>=7; j--)
{
if(j%3==0)
num = num+j;
else
num = num-j;
}
(vii) Determine the data type and value of x after executing the following code:
char Y = ‘5’;
x = Character.isLetter(y);
(x) Write the Java statement for the following mathematical expression :
2
x = − b + b − 4ac
2a
SECTION B
Attempt any four questions from this section.
QUESTION 3.
Write a program that displays the Fibonacci series up to the number of terms specified by the user. For example,
if the user inputs 10, the program should display the first 10 numbers in the Fibonacci sequence.
QUESTION 4.
QUESTION 5.
Write a Java program that prompts the user to enter the size of an array and then the elements of the array.
The program should find and display the largest element in the array.
Input: 4, 3, 8, 6, 1
Output: 8
QUESTION 6.
Create a class that accepts two strings from the user, converts them to upper-case, and checks if they are equal.
If the strings are not equal, display the string with the greater length. If both strings have the same length,
display a message indicating that both strings are of equal length.
QUESTION 7.
Write a program to input the names and percentages of 35 students in Class X, storing them in two separate
one-dimensional arrays. Sort the student details in descending order based on their percentages using the
selection sort method. Finally, display the names and percentages of the top 10 students in the class.
QUESTION 8.
Write a program to accept the names and total marks of N students, storing them in two one-dimensional arrays:
name[] for names and total-marks [] for marks.”.
******