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

ComputerApplicationsPP

This document is a practice paper for a Computer Application exam for Grade X, consisting of two sections: Section A with multiple-choice questions and Section B with programming tasks. Section A includes questions on Java concepts, programming logic, and error types, while Section B requires students to write Java programs based on given specifications. The total marks for the paper are 100, and students are instructed to attempt all questions from Section A and any four from Section B.

Uploaded by

charanpro41
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)
27 views

ComputerApplicationsPP

This document is a practice paper for a Computer Application exam for Grade X, consisting of two sections: Section A with multiple-choice questions and Section B with programming tasks. Section A includes questions on Java concepts, programming logic, and error types, while Section B requires students to write Java programs based on given specifications. The total marks for the paper are 100, and students are instructed to attempt all questions from Section A and any four from Section B.

Uploaded by

charanpro41
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/ 10

Computer Application

(Two hours)
Prelim-2, 2024-25
(Practice Paper)

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 A and any four questions from Section B.
The intended marks for questions or parts of questions, are given in brackets [ ].
_______________________________________________________________________
SECTION A (40 Marks)
Attempt all questions from this Section

Question 1 [20]

(i)

Which java concept does this picture depict?


(a) Single dimensional Array
(b) Double dimensional Array
(c ) Inheritance
(d) Polymorphism

ICSE This paper consists of 10 printed pages Turn over


(ii) What is the highest index of any array with 100 elements?
(a) 98
(b) 99
(c) 100
(d) 101
(iii) Find the output of the following code:
int s=21;
if(s>20)
System.out.print(“under”);
else
System.out.print(“over”);
System.out.println(“the limit”);
(a) under the limit
(b) over the limit
(c) under
(d) over
the limit

(iv) State the type of the loop in the given program segment.
for(int i=5;i<=10;i+=2)
System.out.println(i);
(a) Finite loop
(b) Infinite loop
(c) Null loop
(d) Delay loop
(v) Which one of the below is not an example of actual parameter?
(a) max(10,20)
(b) max(n1,20)
(c) max(n1,n2)
(d) void max (int a, int b)
(vi) Which of the following package contains String functions?
(a) java.String
(b) java.util
(c) java.lang
(d) java.io

ICSE 2
(vii) What will be the output?
int x[]={23,6,3,9,6,12};
System.out.println(x[x.length/2]);
(a) 3
(b) 12
(c) 9
(d ) 6

(viii) Write the output of the following:


System.out.println("COMPUTER".indexOf('c'));
(a) 0
(b) 1
(c) -1
(d) 67
(ix) The array char p[]={‘a’, ’b’} occupies ________
(a) 2 bytes
(b) 4 bytes
(c ) 2 bits
(d) 4 bits
(x) In Java, array elements are stored in _______memory locations.
(a) Random
(b) Sequential
(c) Sequential Random
(d) Stacked
(xi) What is the return type of the following function?
isLetterOrDigit(char)

(a ) String
(b) int
(c) char

(d) boolean

ICSE 3 Turn over


(xii) Which of the following are invoked directly when an object is created?
(a) String
(b) method
(c) Constructor
(d) Integer

(xiii) The error in which the program compiles and executes but shows the incorrect
output.
(a) Syntax error

(b) Logical error

(c) Runtime error

(d) Memory error

(xiv) Which of the following access control must be used for the main method to be
invoked by the JVM?
(a) private
(b) public
(c) protected
(d) No access
(xv) The statement (1 > 0) | | (1< 0) evaluates to
(a) 0
(b) 1
(c) true
(d) false
(xvi) Library classes are:______
(a) Set of pre-defined classes
(b) Set of user defined classes
(c) Set of used classes
(d) None of these

ICSE 4
(xvii) Which of the following is NOT true for polymorphism?

(a) All methods have the same name.

(b) Methods are invoked based on the arguments.

(c) Methods should have the same number and the same type of arguments.

(d) It is a principle of OOPs.

(xviii) For which of the following data types, the size of the variable declared will be
fixed?
(a) Primitive

(b) Reference

(c) Composite

(d) None of these


(xix) Assertion (A): Local variables are declared in a method, constructor or block.
Reason (R): Local variables are not visible outside the method, constructor or
block.

(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) A student performs a selection sort on the following integer array to arrange it in
ascending order.
{9,20,7,15,8}
After the first iteration the array is
{7,20,9,15,8}
What would be the array after the next comparison?
(a) {7,8,15,20,9}
(b) {7,8,9,15,20}
(c) {7,8,20,15,9}
(d) {7,8,9,20,15}

ICSE 5 Turn over


Question 2
[2]
(i) Rewrite the following code using while loop.
int a= 100;
for(int b=2; b<=30; b=b+5)
{
System.out.println(“\n”+(b+a));
a=a-2;
}

(ii) Write the output of the following code and how many times will the loop
[2]
execute?
a=5; b=2;
while(b!=0)
{
int r=a%b;
a=b;
b=r;
}
System.out.println(“ a=” +a);

[2]
(iii) State the method that:
(a) converts a String to a primitive float data type.
(b) checks if the entered character is space, tab or newline

(iv) Distinguish between [2]


(a) Instance variable and Class variable
(b) Private and Protected modifier

[2]
(v) Write Java statements to:
(a) Display the total number of elements in the String[] words array.
(b) Convert the fourth element of the array to uppercase.

(vi) What is autoboxing in Java? Give an example. [2]

ICSE 6
(vii) public static int operate (int a, int b) [2]
{
int c=a++ + ++a-a;
int d=c+ b- - + - -b;
return d;
}

(a) Write a single statement that calls the method operate if it is a member of
class “Mathematics” and values 20 and10 are passed.
(b) What will the method return if a and b are passed as 5 and 10
respectively?

(viii) Write a prototype for a function discount() which accepts two double value and [2]
one integer value and returns double.

(ix) A student is writing a program to display only the alphabets stored in a character [2]
array. While compiling the code, he has made some errors. Debug the code and
write the correct statement

char arr[]={'a','e','6','o','u','%','@'};
int i;
for(i=0;i<arr.length();i++)
{
if(Character.isLetter(arr[i]))
System.out.println(arr);
}

(x) Name the type of conversion in the given statements. [2]


(a) double x=15.2;
int a=(int)x;
(b) int x=12;
long y=x;

ICSE 7 Turn over


Section B
(Answer any four questions from this Section.)
The answers in this section should consist of the programs in either BlueJ environment or any
program environment with java as the base.
Each program should be written using variable description / mnemonic codes so that the log-
ic of theprogram is clearly depicted.
Flowcharts and algorithms are not required.

Question 3 [15]
Define a class Anagram to accept two words from the user and check whether they are
anagram of each other or not.
[An anagram of a word is another word that contains the same characters, only the order of
characters is different.]
For example, NOTE and TONE are anagram of each other.

Question 4 [15]
Write a program to accept 10 names (in alphabetical order A-Z) and their corresponding
telephone numbers in two different arrays.
Accept in the name of a person and display telephone no of the corresponding person using
binary search.

Question 5 [15]
Define a class to accept values into a 3x3 array and check if it is a Losho grid or not.
A grid is a Losho grid if the sum of each row and column equals 15.
Print appropriate messages.
Example: 4 9 2
357
816

ICSE 8
Question 6 [15]
Define a class PhoneBill with the following descriptions:
Data members:
customerName : to store the name of the customer
phoneNo : to store the mobile number of the customer
no_of_unit : to store number of calls made
rent : to store monthly rent
amount : to store amount to be paid.

Member Methods:
PhoneBill() : to initialize with default value to each data member.

accept() : to accept customer name, phone number, number of units and rent.

calculate() : to calculate the amount as rent + cost for the units,


where cost for the units is to be calculated according to the following conditions:
First 50 calls : Free
Next 100 calls : Rs. 0.80/unit
Next 200 calls : Rs. 1.00/unit
Remaining calls : Rs. 1.20/unit

display() : to display the values of all the data members on the screen
main() : Create an object and invoke the above methods.

Question 7 [15]
Define a class to overload the method display() as follows
void display() :to print the following pattern using nested loop
12121
12121
12121
12121
void display(int n) -To display the sum of the series given below:
𝟏 𝟐 𝟑 𝟒
− + − + ⋯ . . 𝑛 𝑡𝑒𝑟𝑚𝑠
𝟐 𝟑 𝟒 𝟓

Write a main method to create an object and invoke the above methods.

ICSE 9 Turn over


Question 8 [15]
Accept a number and check whether it is a Strontio number or not. Strontio numbers are those 4
digit numbers which when multiplied by 2 give the same digit at the hundreds and tens place.
Strontio number example: 1386*2=2772
1221*2=2442

************

ICSE 10

You might also like