icjecapu14

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

ICSC Class 10 Computer Applications Sample Paper 14 Page 1

Sample Paper 14
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 s = “123”, which of the following options correctly converts it into an integer?
(a) int a = integer(s) (b) int a = int(s);
(c) int a = parseInt(s) (d) int a = Integer.parseInt(a);

(ii) Give the output of the following:


int x=2, y=4, z=1;
int result = (++z)+y+(++x)+(z++);
(a) 11 (b) 12
(c) 10 (d) 9

(iii) Which of the following functions is used to check if a given character is a tab space?
(a) is Tab () (b) is Tab Space ()
(c) is Space () (d) is White Space ()

(iv) Identify the incorrect statement among the following:


(a) String objects are immutable, they cannot be changed.
(b) String object can point to some other reference of string variable.
(c) String Buffer class is used to store string in a buffer for later use.
(d) None of the above

(v) How can a member with a protected modifier be accessed?


(a) Only within the class
(b) Only within the package
(c) Within the package and outside the package, but only through inheritance
(d) Accessible by all

Install NODIA App to See the Solutions.


Click Here To Install
Page 2 Sample Paper 14 NODIA

(vi) Which statement causes program control to return to the caller of the method?
(a) return (b) jump
(c) selection (d) iteration

(vii) In Java, arrays are considered:


(a) objects (b) object reference
(c) primitive data type (d) None of these

(viii) In a linear search algorithm, the average case occurs:


(a) when the item is somewhere in the middle of the array.
(b) when the item is not the array at all.
(c) when the item is the last element in the array.
(d) when item is the last element in the array or item is not there at all.

(ix) Which of the following is essential in a program for documentation or explanation purposes?
(a) Comments (b) Blocks
(c) Statements (d) Variables

(x) Is binary search applicable to any sorted data?


(a) Yes (b) No
(c) Depend on array’s size (d) Depend on elements of array

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


class conversion
{
public static void main(String
args[])
{
double a = 295.04;
int b = 300;
byte c = (byte) a;
byte d = (byte) b;
System.out.println(c+ “ ” +d);
}
}
(a) 38 43 (b) 39 44
(c) 295 300 (d) 295.04 300

(xii) The term _____ refers to the ability to take on multiple forms.
(a) inheritance (b) polymorphism
(c) literal (d) encapsulation

(xiii) Which of the following is a keyword used in Java?


(a) boolean (b) default
(c) import (d) All of these

(xiv) What is the term used for changing one data type to another?
(a) Comment (b) Block
(c) Variable (d) Type casting

Install NODIA App to See the Solutions.


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

(xv) A/An _____ can access all fields and methods of a class.
(a) class (b) variable
(c) data type (d) object

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


String s= “Today is test”;
System.out.print(s.indexOf(‘T’));
System.out.print(s.substring(0,7)
+ “ ” + “holiday”);
(a) 0 Today is holiday (b) 0 Today i holiday
(c) Error (d) Exception

(xvii) Assertion (A) : Local variables are declared within a method, constructor, or block.
Reason (R) : Local variables are not accessible 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.

(xviii) Read the following text and choose the correct answer:
Java streams allow functional-style operations on sequences of elements. A stream is an abstraction that
applies a series of functions to data in a specific order without modifying the data itself. Unlike collections,
a stream does not store elements directly.
Which of the following stream contains the classes which can work on character stream?
(a) Input Stream (b) Output Stream
(c) Character Stream (d) All of the mentioned

(xix) Assertion (A) : A while loop is a top-testing or entry-controlled loop.


Reason (R) : A while loop first executes the statement, then checks the condition.
(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 method of the String class is used to compare two string objects for equality?
(a) equals( ) (b) Equals( )
(c) is equal( ) (d) Is equal( )

QUESTION 2.

(i) Write the syntax for a switch statement.

(ii) Examine the following code and determine how many times the loop will execute:
int sum=0, score = 0;
double t;
do
{
score = score +1;

Install NODIA App to See the Solutions.


Click Here To Install
Page 4 Sample Paper 14 NODIA

sum = sum + score;


}
while(score <=4);
t=sum/4;

(iii) Identify the error(s) in the following code and underline the correct parts:
int m=4; n=10;
while(n>=1)
{
System.out.print(“m”);
n-;
}

(iv) When the value of a = 8 than find the value of th following expression a–= + + a +a++ +4 – a+6.

(v) What will be the output of the following program segment?


int a=1000;
while(false)
{
if(a<50)
break;
a=a-10;
}
System.out.println(a);

(vi) Rewrite the following code using a for loop:


int i=2;
int d=6;
do
{
d=d*2;
System.out println(d);
i++;
}while(i<=6);

(vii) Write the values of r and s after the execution of the following code.
int p=11, q=21, r, s;
r=++q;
s=p++;
r++;

(viii) Write the Java statement for the following mathematical expression

p = a2 + b2
b a

(ix) Name the operators listed below.


(a) ?: (b) & &
(c) <= (d) + +

Install NODIA App to See the Solutions.


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

(x) Evaluate the following expressions, when int a=8, b= 14.


(a) b/a+ + (b) – – a+b – – +a

SECTION B
Attempt any four questions from this section.

QUESTION 3.

A class named DeciOct is defined to convert a decimal number into its corresponding octal representation. The
details for some of the members of this class are provided below.

Class name DeciOct


Data members/Instance variables
n To store the decimal number
oct To store the octal equivalent number
Member functions
void getnum (int nn) Assign nn to n
void deci_oct() Calculates the octal equivalent of n and stores it in oct
void show() Displays the decimal number n, calls the function deci_oct() and
displays its octal equivalent.
Specify the class DeciOct, giving details of void getnum(int), void deci_oct() and void show().
Also define a main() function to create an object of the class and call the functions accordingly to enable
the task.

QUESTION 4.

An emirp number is a number, which is prime backwards and forwards.

For example : 13 and 31 are both prime numbers.

Thus, 13 is an emirp number. Design a class Emirp to check, if a given number is Emirp number or not.

QUESTION 5.

Define a class that declares an array of size 20 with elements of type double. Include methods to perform the
following tasks:
(i) Calculate and display the sum of all elements in the array.
(ii) Determine and display the highest value in the array.
Additionally, include functionality to accept elements into the array.

QUESTION 6.

Write a program to print following patterns.


(i) 5 5 5 5 5 (ii) A
4 5 5 5 5 AA

Install NODIA App to See the Solutions.


Click Here To Install
Page 6 Sample Paper 14 NODIA

3 4 5 5 5 ABA
23455 ACCA
1 2 3 4 5 ADFDA

QUESTION 7.

Define a class called ElectricBill that includes the following specifications:


Class ElectricBill
Instance variables/data members
String n to store the name of the customer
int units to store the number of units consumed
double bill to store the amount to be paid
Member methods
void accept() to accept the name of the customer and number of units consumed
void calculate() to calculate the bill as per the following tariff:
Number of units Rate per unit
First 100 units Rs. 2.00
Next 200 units Rs. 3.00
Above 300 units Rs. 5.00
If the number of units consumed exceeds 300, a surcharge of 2.5% is applied.
Define a method void print() to display the details in the following format:
Customer Name: _____
Units Consumed: _____
Bill Amount: _____
Write a main method to create an instance of the ElectricBill class and invoke the relevant methods to
display the customer’s bill details.

QUESTION 8.

Write a program that takes an input string from the user and calculates:
1. The total number of characters in the string.
2. The number of consonants in the string.
e.g. Input Enter a string : Hello
Output Total number of characters: 5
Number of consonants : 3

******

Install NODIA App to See the Solutions.


Click Here To Install

You might also like