0% found this document useful (0 votes)
20 views

COMP PP

Uploaded by

charanpro41
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

COMP PP

Uploaded by

charanpro41
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

COMPUTER APPLICATION

(Two hours)
Practice Paper-I, 2024-2025
GRADE: X Max. Marks: 100

Answers to this Paper must be written on the paper provided separately.


You will not be allowed to write during the first 15 minutes.
This time is to be spent in reading the Question Paper.
The time given at the head of this Paper is the time allowed for writing the answers.
__________________________________________________________________
Attempt all questions from Section I and any 4 questions from Section II.
The intended marks for questions or parts of questions, are given in brackets[ ].
________________________________________________________________

SECTION I (40 Marks)


Attempt all questions from this Section

Question 1 [20]
(i)

What is the process done in the above picture?


a. Sorting the list in descending order.
b. Searching the character in the list.
c. Sorting the list in ascending order.
d. None of the above.

(ii) Assertion(A): Call by value is known as pure method.


Reason(R): The original value of variable does not change as operation is performed
on copied values.
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)

ICSE This Paper consists of 8 printed pages Turn over


c. Assertion (A) is false and Reason (R) is true
d. Assertion (A) is true and Reason (R) is false

(iii) Consider the array given below:


char ch[]={‘A’, ‘E’, ‘I’, ‘O’, ‘U’};
Write the output of the following statement:
System.out.println(ch[0]*2);
a. 65 b. 130
c. ‘A’ d. 0

(iv) Method prototype for the method calculation which accepts two character arguments
and returns true/false.
a. void calculate(char a, char b) b. boolean calculate(char a, char b)
c. Boolean calculate(char a,b) d. int calculate(char a, char b)

(v) Assertion: A class can have multiple constructors.


Reason: Multiple constructors are defined with same set of arguments.
a. Assertion is true, Reason is false.
b. Both Assertion and Reason are true.
c. Both Assertion and Reason are false.
d. Assertion is false, Reason is true.

(vi) A single dimensional array has 20 elements, which of the following is a correct
statement to initialize the last element to 50.
a. A[21]=50 b. A[18]=50
c. A[19]=50 d. A[20]=50

(vii) If String s=”Computer” , Which of the following function s returns a String?


a. s.length()
b. s.charAt(i)
c. s.replace(‘o’, ‘*’)
d. s.indexOf(‘r’);

(viii) Assertion(A): Integer class can be used in the program without calling a package.
Reason(R): It belongs to the default package java.lang.
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

(ix) Which of the following is a valid java keyword?


a. Else b. INTEGER
c. void d. For

ICSE 2
(x) Which of the following is the CORRECT statement to invoke a method with the
prototype int display(int a, char b)?
a. int n= display(‘P’,20)
b. int n=display();
c. int n= display(20, ‘P’);
d. int n= display(20, P);

(xi) Conversion of a wrapper class object to its primitive type is known as:
a. unboxing b. autoboxing
c. type casting d. parsing

(xii) A girl wanted to calculate the sum of two numbers stored as a and b multiplied by 7.
Select the appropriate Java expression.
a. a+b*7
b. 7*a+b
c. (a+b)*7
d. a+7*b

(xiii)

How many bytes are occupied by the above one dimensional array?
a. 5 bytes b. 10 bytes
c. 20 bytes d. 15 bytes

(xiv) The Vivanta hotel gives the amount to be paid by the customer as an integer, which of
the following method rounds off the bill in decimals to an integer?
a. Math.round() b. Math.Round()
c. Math.roundoff() d. Math.RoundOff()

(xv) A package is a :
a. Collection of data.
b. Collection of functions.
c. Collection of classes.
d. A nested class.

(xvi) Read the following text and choose the correct answer
The data members or member methods which are specified as private are used only
within the scope of a class. These members cannot be accessed outside the class
visibility. Next clue
Which of the following statement is most appropriate for the private members?
a. They are visible outside the class in which they are defined.
b. They can be used in the sub class.
c. They are only visible in the class in which they are declared.
d. They are globally visible.

ICSE 3 Turn over


(xvii)

Which of the following options best describes the above illustration?


a. Constructor Overloading b. Constructor
c. Function Overloading d. Parameterised Constructor

The output of the java statement “SOLDIER”.compareTo(“SALUTE”); is


(xviii)
a. -4 b. 14
c. -14 d. 0

Which of the following is used to initialize the instances of class?


(xix)
a. Arrays b. Strings
c. Constructor d. Objects

What is the output of the given code:


(xx)
double b=-15.6;
double a=Math.ceil(Math.abs(b));
System.out.println(“a=”+a);
a. 14.0 b. 15.0
c. 16.0 d. 17.0

Question 2
(i) How many times the given loop is executed? Give the output of the same. [2]
for(k=10;k<=20;k+=4)
{
System.out.println(k);
if(k%3==0)
continue;
}

(ii) Consider the array: [2]


int a[]={12,35,40,22,56,9,70};
(a) In the above given array, using linear search, how many iterations are required
to check for the existence of the value 56?
(b) If the array is arranged in descending order, how many iterations are required to
check for the existence of 56 using linear search?

ICSE 4
(iii) Consider the given program and answer the questions given below: [2]
class temp
{
int a;
temp()
{
a=10;
}
temp(int z)
{
a=z;
}
void print()
{
System.out.println(a);
}
void main()
{
temp t = new temp();
temp x = new temp(30);
t.print();
x.print(); } }
a. What concept of OOPs is depicted in the above program with two constructors?
b. What is the output of the method main()?

(iv) What is the data type that the following functions return? [2]
a. isWhiteSpace(char ch)
b. Math.random()

3
(v) Write the Java expression for √𝑥 + √𝑦 [2]

(vi) What is the value of m after evaluating the following expression: [2]
m += 10% ++n +n++ /4 , when m=12 and n=3.

(vii) Consider the following method which calculates and returns the Norm of a matrix. [2]
Norm is square root of sum of squares of all elements.
Fill in the blanks (a) and (b) with appropriate java statements:
double norm()
{
int x[][]={{1,5,6},{4,2,9},{6,1,3}};
int r, c, sum=0;

ICSE 5 Turn over


for(r=0;r<3;c++)
{
for(c=0; c<3;c++)
sum=sum + ____(a)____;
}
_____(b)_____;
}

(viii) Predict the output of the following code snippet: [2]


char ch= ‘B’;
char chr = Character.toLowerCase(ch);
int n =(int) chr-10;
System.out.println((char)n + “\t” +chr);

(ix) Consider the following program segment and answer the questions given: [2]
for(int k=1;k<=5;k++)
System.out.println(k);
System.out.println(k);
a. Will the program segment get executed successfully?
b. If not, state the type of error. How do you correct the program if it has any error?

(x) Why is a class known as composite data type? [2]

ICSE 6
SECTION II (60 Marks)
Attempt any four questions from this section.

Question 3 [15]
Design a class with the following specifications:

Class name Eshop


Member variables:
String name: Name of the item purchased.
double price: Price of the item purchased.

Member methods
void accept(): Accept the name and price of the item using the Scanner class.
void calculate(): To calculate the net amount to be paid by a customer, based on
following criteria:

Price Discount
1000- 25000 5.0%
25001-57000 7.5%
57001-100000 10.0%
More than 100000 15.0%

void display(): To display the name of the item and the net amount to be paid.
Write the main method to create an object and call the above methods.

Question 4 [15]
Write a program in Java to create a 3 x 3 square matrix and store numbers in it. The
programmer wants to print the given Matrix and check whether the matrix is a symmetric
matrix or not. A square matrix is said to be symmetric if the elements of the ith row and jth
column is equal to the elements of the jth row and ith column.
For Example :
A Symmetric matrix:
1 2 3

2 4 5

3 5 6

ICSE 7 Turn over


Question 5 [15]
Write a program to accept a sentence and print only the first letter of each word of the
sentence in capital letters separated by a full stop.
Example :
INPUT SENTENCE: “This is a cat”
OUTPUT: T.I.A.C.

Question 6 [15]
Write a program in Java to store 10 words in a Single Dimensional Array. Display only those
words which are Palindrome.
Sample Input: MADAM, TEACHER, SCHOOL, ABBA, .........
Sample Output: MADAM ABBA .......... ..........

Question 7 [15]
Define a class to accept a four-digit number and check if it is a USHWA number or not.
The number is said to be USHWA if:
Sum of all digits= 2× (sum of first and last digit)
Example 1: n =1234
Sum of first and last digit = 1+4=5
Sum of all digits =1+2+3+4=10
Sample output: It is a USHWA number
Example 2: If the input value is 354, then an error message should be given.

Question 8 [15]
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 5
void 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
void print(char ch, int a): If ch=s or S print the square of the number and if ch=c or C
print the cube of the number.

ICSE 8

You might also like