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

Icjecapu 15

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)
54 views6 pages

Icjecapu 15

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 15 Page 1

Sample Paper 15
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) Given the array:


String a[ ]= {“Artificial intelligence”, “IOT”, “Machine learning”, “Big data”};
What will be the output of the following code?
System.out.println(a[3]);
(a) Artificial intelligence (b) Big data
(c) IOT (d) String

(ii) What will be the output of the following Java program?


class c
{
public void main(String[] args)
{
System.out.println(“Hello” +
args[0]);
}
}
(a) Hello c (b) Hello
(c) Hello world (d) Runtime error

(iii) Which of the following statements functions as a multi-way branch statement?


(a) if (b) if-else
(c) nested if (d) switch
Continue on next page.....

Install NODIA App to See the Solutions.


Click Here To Install
Page 2 Sample Paper 15 NODIA

(iv) Can a negative number be used as the size of an array?


(a) Yes (b) No
(c) Cannot say (d) Cannot define

(v) What type of package is java.util?


(a) built-in package (b) user defined package
(c) importing (d) None of the above

(vi) What term describes a construct that combines various primitive types to use them as a single unit?
(a) Object (b) Class
(c) Abstraction (d) Variable

(vii) Identify the keyword that is not used in exception handling:


(a) try (b) finally
(c) thrown (d) catch

(viii) What will be the output of the following code?


int n = 97;
char ch =
Character.toUpperCase((char)n);
System.out.println(ch + “Greatmen”);
(a) A Great Victory (b) Great Victory
(c) Error (d) Cannot define

(ix) When an expression contains data types such as double, int, float, and long, into which data type will the
entire expression be promoted??
(a) long (b) int
(c) double (d) float

(x) Which of the following classes is the superclass of both the String and StringBuffer classes?
(a) java.util (b) java.lang
(c) ArrayList (d) None of these

(xi) In Java, how many types of exceptions are there?


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

(xii) Which of the following is a method with the same name as its class?
(a) finalise (b) delete
(c) class (d) constructor

(xiii) The value of () function converts :


(a) primitive type to string (b) string to primitive type
(c) Both (a) and (b) (d) None of the above

(xiv) It means that the same operations may behave differently on different classes.
(a) Inheritance (b) Polymorphism
(c) Encapsulation (d) Data abstraction

Install NODIA App to See the Solutions.


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

(xv) Which method of the String class is used to retrieve a single character from a string object?
(a) CHARAT( ) (b) charat( )
(c) charAt( ) (d) CharAt( )

(xvi) _______ is a container that stores values used in a Java program.


(a) Identifier (b) Instance
(c) Token (d) Variable

(xvii) Assertion (A) : Encapsulation prevents the client from seeing its internal view.
Reason (R) : Encapsulation is implemented in Java using interfaces and abstract classes.
(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:
Method overloading enables multiple methods to share the same name but have different signatures.
The signature can vary based on the number of input parameters, the type of input parameters, or a
combination of both. In Java, method overloading is also referred to as Compile-time Polymorphism, Static
Polymorphism, or Early Binding.
What is the process of defining two or more methods within same class that have same name but different
parameters declaration?
(a) Method overloading (b) Method overriding
(c) Method hiding (d) None of the mentioned

(xix) Assertion (A) : A string refers to a set of characters..


Reason (R) : A Java string is an object created from the String class.
(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) The Scanner class is available in the _____ package.


(a) java.util (b) java.package
(c) java.input (d) java.byte

QUESTION 2.

(i) If a =15, b = 10, find the value of


a*=++a/6+b++%3+4.

Continue on next page.....

Install NODIA App to See the Solutions.


Click Here To Install
Page 4 Sample Paper 15 NODIA

(ii) How many times will each of the following loops execute? Also, identify which loop is entry-controlled and
which is exit-controlled.
Loop 1 Loop 2
int n=10, sum=0; int n=10, sum=0;
while(n>1) do
{ {
sum+=n; sum +=n;
n-=3; n—=3;
} } while(n>1);

(iii) The following code contains errors. Please rewrite the corrected version, underlining all the changes made.
Int x=1; y=9;
do;
{
++x;
y— =x— —;
}
whi1e(x<9)
return y

(iv) Rewrite the following code using a while loop.


int x=1, y=2;
for(x=1; x<=10; x++,y+=1)
{
System.out.println(“ ”+x++);
}
System.out.println(null,“Complete”);

(v) What will be displayed after the following code is executed?


public class Main {
public static void main(String[] args) {
String color;
String Name = “Bajaj”;
color = Name.concat(“ “ + “Yellow”);
System.out.println(Name.replace(‘j’, ‘J’));
System.out.println(color.toUpperCase());
}
}

(vi) Observe the following code and determine the output:.


int S=25;
if(S<20)
System.out.println(“Under ”);
else
System.out.println(“Over ”);
System.out.print(“the limit”);

Continue on next page.....

Install NODIA App to See the Solutions.


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

(vii) Given x = 40 and y = 20, determine the result of the following expressions:
(a) x+ =y;
(b) x%=y;

(viii) Write the Java statement for the following mathematical expression:
3 3
m= a +b
^a + b h

(ix) What will be the content of L after executing the following code?
String F1=“I#N#T#E#R”, F2;
//(#) represents a space
F2=F1.trim();
int L = F2.length();
System.out.print(L);

(x) “Assume that x1 and x2 are two variables of type double, and you want to add them as integers and assign
the result to an integer variable. Write a Java statement that performs this operation.”

SECTION B
Attempt any four questions from this section.

QUESTION 3.

Write a Java program to compute tax for residents of Mumbai. Define a class named TaxCalculator based on
the class description provided.

Class name TaxCalculator


Data members int PAN String name double taxablelncome double tax
Member methods inputData( ) displayData( ) computeData( )
The tax is calculated according to the following rules:
Total Annual Taxable Income Rate of Taxation
Up to 60000 0%
Above 60000 but up to 150000 5%
Above 150000 but up to 500000 10%
Above 500000 15%

QUESTION 4.

Define a Student class with the following instance variables: name, age, m1, m2, m3 (marks in three subjects),
maximum (highest mark), and average.

Define the following member methods in the Student class:


1. Student(...): A parameterized constructor to initialize the data members.
2. acceptDetails(): A method to accept student details.
3. compute(): A method to calculate the average and find the maximum of the three marks.

Install NODIA App to See the Solutions.


Click Here To Install
Page 6 Sample Paper 15 NODIA

4. display(): A method to display the student’s name, age, marks in three subjects, maximum, and average.
Write a main method to create an object of the Student class and call the above methods.

QUESTION 5.

Write a program to print the following patterns.


(i) 5 (ii) J
4 5 I H
3 4 5 G F E
2 3 4 5 D C B A
1 2 3 4 5

QUESTION 6.

Write a Java program to print the following pattern.


(i) 5 4 3 2 1 (ii) H
4 3 2 1 H E
3 2 1 H E L
2 1 H E L L
1 H E L L O
H E L L
H E L
H E
H

QUESTION 7.

Write a Java program to sort an array in ascending order using the bubble sort algorithm.

QUESTION 8.

Write a program to accept the year of school graduation as an integer from the user. Use the binary search
technique on the sorted array of integers provided below. If the entered year is found in the array, display
“Record exists”; otherwise, display “Record does not exist.”

{1981, 1986, 1992, 1995, 1998, 2002, 2005, 2006, 2008, 2009}

******

Install NODIA App to See the Solutions.


Click Here To Install

You might also like