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

Icjecapu 03

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 03

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

Sample Paper 03
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) A benefit of encapsulation is _____.


(a) The interface of the class will be smaller.
(b) The implementation can be changed without altering programs that use the class.
(c) The implementation of the class will be smaller.
(d) The interface can be changed without modifying programs that use the class.

(ii) Which of the following is a program or set of programs that converts source code into byte code?
(a) Java Source Code (b) Interpreter
(c) Byte code (d) Java Compiler

(iii) It is a composite data type because it requires to use its attributes.


(a) Array (b) Object
(c) Integer (d) Class

(iv) Which is not a true statement about array?


(a) An array expands automatically when it is full.
(b) An array is allowed to contain duplicate values.
(c) An array understands the concept of ordered elements.
(d) An array uses a zero index to reference the first element.

Continue on next page.....

Install NODIA App to See the Solutions.


Click Here To Install
Page 2 Sample Paper 03 NODIA

(v) Determine the output of the following functions.


String x=“Computer”;
String y=“Applications”;
System.out.println(x.indexOf(x.
charAt(4)));
(a) 4 (b) 5
(c) 3 (d) 2

(vi) What is the final value stored in variable x?


double x = Math.ceil(Math.
abs(- 7.3)):
(a) 7.0 (b) 8.0
(c) 6.0 (d) 9.0

(vii) Determine the output of the following code segment.


String myStr1 = “Hello”;
String myStr2 = “Hello”;
System.out.println(myStrl.
compareTo(myStr2));
(a) 11 (b) 2
(c) 3 (d) 0

(viii) These statements can be used to modify the behavior of conditional and iterative statements.
(a) Switch statements (b) Iterative statements
(c) Selection statements (d) Jump statements

(ix) An array is a ______ data type.


(a) Integer (b) String
(c) Composite (d) Mixed

(x) Which of the following methods can be used to join two strings?
(a) Concat( ) (b) Concatenate( )
(c) Trim( ) (d) Join( )

(xi) Which of the following concept can be used for encapsulation?


(a) Using interfaces
(b) Hiding data and internal methods using access modifiers in a class
(c) Wrapping data fields with methods
(d) All of the above

(xii) Variables that are shared by every instances of a class are______.


(a) Public variables (b) Private variables
(c) Instance variables (d) Class variables

(xiii) In Java, a library of classes is called_____.


(a) An application (b) A package
(c) A directory (d) A folder
Continue on next page.....

Install NODIA App to See the Solutions.


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

(xiv) How many types of print statements are there in Java?


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

(xv) The order of the three top level elements of Java source file is
(a) Import, package, class (b) Class, import, package
(c) Package, import, class (d) Any order

(xvi) The keyword to create an object of a class is


(a) create (b) new
(c) New (d) NEW

(xvii) Assertion (A) : Pure functions define a relationship between input and output.
Reason (R) : A 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.

(xviii) Read the following text and choose the correct answer:
In Java, a constructor is used to create an instance of a class. Constructors are similar to methods but differ
in two ways: they have the same name as the class and no return type. Constructors are often called special
methods, as they initialize an object when it’s created.
Which of the following is true about constructor?
(a) It can contain return type.
(b) It can take any number of parameters.
(c) It can have any non- access modifiers.
(d) It cannot throw an exception.

(xix) Assertion (A) : static methods can only call static method within from them.
Reason (R) : static methods can refer this and super.
(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) To declare a method in Java, choose the required components.


(a) Modifier (b) Return type
(c) Method name (d) All of these

QUESTION 2.

(i) Write down the two purposes of + operator in Java.

Continue on next page.....

Install NODIA App to See the Solutions.


Click Here To Install
Page 4 Sample Paper 03 NODIA

(ii) Obtain the output of the following code in Java.


int x=0;
while(x<=1)
{
System.out.println(“x\n”);
x=x+1;
}

(iii) What happens, if we do not include break statement with a case in switch statement?

(iv) What will be the value of variables m and n after the execution of the following code?
int m, n=0;
for(m=1; m<=4; m++)
{
n+ = m;
n–-;
}

(v) Write the corresponding Java expression for the following mathematical expression :
xy
z = x3 + y2 −
2

(vi) Find the value of following statements :


(a) Math.floor(1.9);
(b) Math.round(4.5);

(vii) The following code has some error(s). Rewrite the correct code and underlining all the correction made :
float m=6, float n=1, p=1;
do;
{
p==p*n;
n++;
while(n<=m);
System.out.print(“ ”+p);
}

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


String s = “Madam”;
System.out.println(s.indexOf(‘d’));
System.out.println(s.lastIndexOf
(‘m’));

(ix) Given the following set of identifiers


char c; byte b;
int i; short s;
long l; float f;
Identify the data type of i*l+ f expression.

Continue on next page.....

Install NODIA App to See the Solutions.


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

(x) Rewrite the following program code using if-else statement :


int a = 2;
switch(a)
{
case 0:
GrandTotal=0.10*BillAmt;
break;
case 1:
GrandTotal=0.9*BillAmt;
break;
case 2:
GrandTotal=0.8*BillAmt;
break;
default:
GrandTotal=BillAmt;
}

SECTION B
Attempt any four questions from this section.

QUESTION 3.

Create a class named Armstrong with a main function to determine if a user-entered number is an Armstrong
number. An Armstrong number is a number that equals the sum of the cubes of its digits.

Examples of Armstrong numbers include 0, 1, 153, 370, 371, and 407.

QUESTION 4.

Write a Java program that prompts the user to enter the elements of an array and checks for the occurrences of
positive numbers, negative numbers, and zeros.

e.g. Input Array : 12, – 89, – 56, 0, 45, 56

Output 3 Positive Numbers

2 Negative Numbers

1 Zero

QUESTION 5.

Define a class Anagram which will check that entered string is anagram or not.

An anagram is a string, which contains same characters but in different order.

e.g. army and mary.

Continue on next page.....

Install NODIA App to See the Solutions.


Click Here To Install
Page 6 Sample Paper 03 NODIA

QUESTION 6.

A class Tel call calculates the monthly phone bill of a consumer. Some of the members of the class are given
below:

Class name Tel call


Data members/Instance variables
Phone no. Phone number
Name Name of consumer
N Number of calls made
Amt Bill amount
Member functions/Methods
Tel call(...) Parameterized constructor to assign values to data members
Void compute() To calculate the phone bill amount based on the slabs given below:
N u m b e r Rate
of calls
1-100 Rs. 500/- rental charge only
101-200 Rs. 1.00/- per call rental charge
201-300 Rs. 1.20/- per call rental charge
above 300 Rs. 1.50/- per call rental charge
void dispdata() To display the details in the specified format
The calculations need to be done as per the slabs.
Specify the class Tel call giving the details of the constructor, void compute( ) and void dispdata( ).
In the main() function, create an object of type Telcall and display the phone bill in the following format:
Phone Number XXXXXXXXX
Name XXX
Total calls XXXXX
Amount XXXX

QUESTION 7.

Write a Java program to print the following pattern.


(i) 5 (ii) H ELLO
5 4 H ELL
5 4 3 H EL
5 4 3 2 H E
5 4 3 2 1 H

QUESTION 8.

Write a Java program to read two strings append them together and return the result. If the strings are different
lengths, remove characters from the beginning of longer string and make them equal length.

[Hint If two strings are: “Arihant”, “Publications”, then output would be: “Arihantcations”]
******

Install NODIA App to See the Solutions.


Click Here To Install

You might also like