0% found this document useful (0 votes)
40 views6 pages

Icjecapu 08

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views6 pages

Icjecapu 08

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ICSC Class 10 Computer Applications Sample Paper 08 Page 1

Sample Paper 08
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.)

(i) Which of the following methods returns a boolean value (true or false)?
(a) to Lower Case() (b) to Upper Case( )
(c) parseInt( ) (d) is Upper Case( )

(ii) Can you change the size of an array once you define it?
(a) Yes (b) No
(c) Cannot say (d) It will give an error

(iii) Which of these data type value is returned by equals( ) method of String class?
(a) Char (b) Int
(c) Boolean (d) None of the above

(iv) What will be the output of the following Java code?


class output
{
public static void main(String
args[])
{
String c = “Hello i love java”;
boolean var;
var = c.startsWith(“hello”);
System.out.println(var);
}

Install NODIA App to See the Solutions.


Click Here To Install
Page 2 Sample Paper 08 NODIA

}
(a) True (b) False
(c) 0 (d) 1

(v) When initializing an array, what must be specified?


(a) Row (b) Column
(c) Both (a) and (b) (d) None of the above

(vi) Give the output of the following code.


String a = “Smartphone”;
String b = “Graphic Art”;
String h = b.substring(3, 8);
System.out.println(h);
(a) Art (b) Mart
(c) Mar (d) Sma

(vii) Which of the following is used to declare, construct and initialise an array?
(a) int[ ] arr ={ }; (b) int[ ] arr = (1, 2, 3);
(c) int arr[ ] [ ] = {1, 2, 3, 4}; (d) int arr[ ] = {1, 2, 3};

(viii) How many types of comments are available in Java?


(a) 2 (b) 3
(c) 4 (d) 5

(ix) Which of the following does not belong as a member of a class?


(a) Static function (b) Friend function
(c) Virtual function (d) Const function

(x) How many catch blocks can be used with a single try block?
(a) Only 2 (b) Only 1
(c) As many (d) Maximum 256

(xi) In Java, character literals are enclosed within:


(a) Single quotes (b) Double quotes
(c) Triple quotes (d) None of the above

(xii) ______ are the smallest units or individual elements of a Java program, recognized by the compiler.
(a) Literals (b) Tokens
(c) Keywords (d) Character sets

(xiii) What is the default access level for a class member in Java if no access specifier is provided?
(a) Private
(b) Public
(c) Public, within its own package
(d) Protected

Continue on next page.....

Install NODIA App to See the Solutions.


Click Here To Install
ICSC Class 10 Computer Applications Sample Paper 08 Page 3

(xiv) Which of the following defines a block of statements that may potentially cause an exception?
(a) Try (b) Super
(c) Finally (d) Void

(xv) Give the output of the following:


int x = 5, y = 3, z = 1;
int result = (x++) + (++y) + (z++) + (++x) + (y++);
System.out.print(result);
(a) 14 (b) 15
(c) 16 (d) 21

(xvi) The functions print() and random() are examples of:


(a) Pure functions (b) Impure functions
(c) Static functions (d) None of the above

(xvii) Assertion (A) : Java interpreter decodes and executes byte code for the Java Virtual Machine.
Reason (R) : Java interpreter is actually a part of JVM.
(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.

(xviii) Read the following text and choose the correct answer:
The keyword this in Java is a reference variable that points to the current object instance. It is used to
invoke methods and access fields of the current class, pass the current class instance as a parameter, and
distinguish between local variables and instance variables.
What is not the use of “this” keyword in Java?
(a) Referring to the instance variable when a local variable has the same name.
(b) Passing itself to the method of the same class.
(c) Passing itself to another method.
(d) Calling another constructor in constructor chaining.

(xix) Assertion (A) : Automatic conversion of primitive data types to the object of their corresponding wrapper
classes is known as Auto-boxing.
Reason (R) : Conversion of int to Integer, long to Long, double to Double etc.
(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.

(xx) Which of the following is an example of a checked exception?


(a) IOException (b) Null Pointer Exception
(c) ArithmeticException (d) None of the above

Continue on next page.....

Install NODIA App to See the Solutions.


Click Here To Install
Page 4 Sample Paper 08 NODIA

QUESTION 2.

(i) Write a statement in Java for the following mathematical expression


3
ab + cd

(ii) Write prototype of a function that accepts a boolean type value but does not return anything.

(iii) Find the error(s) in the following program snippet.


for(int i=1; i<=30; i--)
System.out.println(K)

(iv) What will the following functions return?


(a) Math.min (–23, –76);
(b) Math.max(–12,3);

(v) Describe the effect, if we do not include break in a switch case statement.

(vi) What is the purpose of System.exit(0)?

(vii) If int arr[] = {2, 4, 6, 8, 10, 12, 14, 16};


What are the values of a and b ?
(a) = Math.pow(arr[5], arr[1]);
(b) = Math.sqrt(arr[7] + arr[3]);

(viii) Write the output of the following code:


int x = 1;
do {
if (x < 5) {
x = x + 3;
System.out.println(x);
continue;
} else {
System.out.println(x--);
break;
}
} while (x < 10);

(ix) State the output of the following code:


String s1 = “Goodbye”;
String s2 = “Universe”;
System.out.println(s1.substring(1, 4).concat(s2.substring(2, 5)));
System.out.println(“Welcome” + (s1.substring(4).toUpperCase()));

(x) What output do you think the following code will produce, if Number is 3?
int Number = 3; // Assuming Number is 3
if (Number >= 1) {
if (Number % 2 == 0) {

Install NODIA App to See the Solutions.


Click Here To Install
ICSC Class 10 Computer Applications Sample Paper 08 Page 5

System.out.println(“Even number”);
} else {
System.out.println(“Odd number”);
}
} else {
System.out.println(“Negative number”);
}
System.out.println(“End of program”);

SECTION B
Attempt any four questions from this section.

QUESTION 3.

Write a program to input a number and determine if it is a Niven number. A Niven number is one that is
divisible by the sum of its digits. Display whether the given number meets this condition or not.

e.g. Input: 126

Output: 1+2+6=9 and 126 is divisible by 9.

QUESTION 4.

A class Adder has been designed to add two given time values. For instance:

For example

Time A : 6 hours 35 minutes

Time B : 7 hours 45 minutes

The total would be 14 hours 20 minutes (noting that 60 minutes equals 1 hour). The class details are outlined
below.:

Class Name Adder


Data member/Instance variable
a[ ] Integer array to hold two elements (hours and minutes)
Member functions/methods
Adder() Constructor to assign 0 to the array elements
void read time() To enter the elements of the array
void add time(Adder X, Adder Y) Adds the time of the two parameterized objects X and Y and stores
the sum in the current calling object
void disp time() Displays the array elements with an appropriate message (i.e. hours
= and minutes = )
Specify the class Adder giving details of the constructor, void read time( ), void add time(Adder, Adder)
and void disp time( ). Define the main( ) function to create objects and call the functions accordingly to
enable the task.

Install NODIA App to See the Solutions.


Click Here To Install
Page 6 Sample Paper 08 NODIA

QUESTION 5.

Write a program to draw the following patterns.


1 2 3 4 5 A
1 2 3 4 B C
(i) 1 2 3 (ii) D E F
1 2 G H I J
1 K L M N O

QUESTION 6.

Write a Java program that takes an array of elements as input from the user and sorts it in ascending order.

e.g. Input : 4, 5, 2, 0, 7

Output : 0, 2, 4, 5, 7

QUESTION 7.

Define a class to accept a string, convert it to lower case, and check if it is a palindrome. A palindrome is a word
that reads the same forwards and backwards.

Example: madam, race-car etc.

QUESTION 8.

Write a program to accept the names and total marks of N students, storing the data in two single-dimensional
arrays: name[ ] for names and total marks [ ] for their marks..

Calculate and print


(i) The average of the total marks obtained by N number of students.
[average = (sum of total marks of all the students)/N]
(ii) Deviation of each student’s total marks with the average.
[deviation = total marks of a student – average]

******

Install NODIA App to See the Solutions.


Click Here To Install

You might also like