0% found this document useful (0 votes)
17 views9 pages

Comp - QP - ICSE CLASS X

This document is an examination paper for ICSE Class X Computer Science, consisting of multiple-choice questions, coding problems, and programming tasks. It covers various topics such as algorithms, data types, constructors, methods, and class design. The paper is structured into sections with different credit values and marks allocation.

Uploaded by

dibyendu basu
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)
17 views9 pages

Comp - QP - ICSE CLASS X

This document is an examination paper for ICSE Class X Computer Science, consisting of multiple-choice questions, coding problems, and programming tasks. It covers various topics such as algorithms, data types, constructors, methods, and class design. The paper is structured into sections with different credit values and marks allocation.

Uploaded by

dibyendu basu
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/ 9

ICSE CLASS X

Computer Science

Full Marks – 100 Time: 2 Hrs

20 nos Question credit [1] Marks = Total 20 Marks

Q1. The algorithm in which the middle index is found and the array is divided into 2
halves to search for an element is called:

Options

(a) Linear search


(b) Data Search
(c) Long search
(d) Binary search

Q2. Write statements to show how finding the length of a character array char[]
differs from finding the length of a String object str.
Options

(a) char.length() and str.length()


(b) char.length and str.length()
(c) str.length() and char.length()
(d) None of the above

Q3. State the total size in bytes, of the arrays a[4] of char data type and p[4] of float
data type.
Options

(a) 16 Bytes and 8 Bytes


(b) 8 Bytes and 16 Bytes
(c) 16 Bytes and 16 Bytes
(d) 8 Bytes and 8 Bytes

Q4. Given a string str=CompuTerScieNceand ENGINEERING”; The output of


str.substring(5,12) will return ______ characters

Options

(a) 6
(b) 7
(c) 8
(d) 9

Q5. string be created by two methods

Options

(a) Only one method


(b) Different different methods
(c) two methods
(d) three methods

Q6. Memory is allocated for class objects when

Options

(a) Class is defined


(b) Function is called
(c) Both (a) and (b)
(d) Object is created

Q7. The process of converting wrapper class object to primitive data type is called :

Options

(a) Boxing
(b) Unboxing
(c) Conversion
(d) Post Boxing

Q8. Default constructor requires how many parameters?

Options

(a) 3
(b) 0
(c) 2
(d) 1

Q9. Among the following Statements, Which are true about Constructors?
(I) a new operator automatically calls them.
(II) they cannot be private
(III) they cannot be virtual

Options

a) I & III
b) I & II
c) II & III
d) All of the above

Q10. Function prototype means?

Options

(a) Return value of a function


(b) Name of the function
(c) Return type of the function
(d) Return type ,Name and Inputs to a function

Q11. A static method is also called a :

Options

(a) Instance function


(b) Defined function
(c) Class method
(d) Fixed function

Q12. What is the precision of the double data type ?

Options

(a) 5 digits
(b) 7 digits
(c) 15 digits
(d) 10 digits

Q13. What is the type and value of the following expression? (Notice the integer
division) – 4 + 1/2 + 2*–3 + 5.0

Options
(a) int -5
(b) double -4.5
(c) int -4
(d) double –5.0

Q14. How many times ‘Hello’ is printed?


Public static void main(String args[])
{
for(i = 0;i<5;i++)
{
System.out.println(“hello”);
break;
}
}

Options

(a) 5
(b) 4
(c) 1
(d) 0

Q15. How The Scanner class method used to accept words with space:

Options

(a) next()
(b) nextLine()
(c) nextString()
(d) None of these

Q16. What value will Math.sqt (Math. ceil (15.3)) return?

Options

(a) 16.0
(b) 16
(c) 4.0
(d) 5.0

Q17. The absence of which statement leads to fall through situation in which case
statement?
Options

(a) continue
(b) break
(c) return
(d) System.exit(0)

Q18. The output of the function “COMPOSITION”.substring (3, 6):

Options

(a) POSI
(b) POS
(c) MPO
(d) MPOS

Q19. int x = (int) 32.8; is an example of .................. typecasting.

Options

(a) implicit
(b) automatic
(c) explicit
(d) coercion

Q20. A method which does not modify the value of variables is termed as:

Options

(a) Impure Method


(b) Pure Method
(c) Primitive Method
(d) User Defined Method

10 nos Question credit [2] Marks = Total 20 Marks

Q1. The following code will produce output as :

Options

public class Exam


{
public static void main(String[] args)
{
String s="ICSE2021";
system.out.println
(s.substring(4)+s.length());
}
}
Options
(a) 20218
(b) 2029
(c) Error
(d) 2030

Q2. In the program given below, state the name and the value of the:

(i) method argument or argument variable.


(ii) class variable.
(iii) local variable.
(iv) instance variable
class myClass.
{
static int x = 7;
int y = 2;
public static void main(String args[])
{
myClass obj = new myClass();
System.out.println(x);
obj.sampleMethod(5);
int a = 6;
System.out.println(a);
}
void sampleMethod(int n)
{
System.out.println(n);
System.out.println(y);
}
}
Q3. Evaluate the expression :

z = ++x * (y– –)–y


where, x = 20, y = 10, z;

Q4. Rewrite the following condition without using logical operators :

if (a > b | | a > c)
System.out.println(a);

Q5. Evaluate the expression when the value of x = 4:

x* = – – x + x + + + x

Q6. Give the output of the following Character class methods:

(a) Character. to Upper Case(‘a’)

(b) Character. is Letter Or Digit (‘#’)

Q7. Give the output of the following program segment:

int n = 4279; int d;

while(n>0)

{d = n%10; System.out.println(d);

n = n/100; }

Q8. Give the output of the following String class methods:

(a) “COMMENCEMENT”. last IndexOf (‘M’)

(b) “devote”.compareTo (“DEVOTE”)

Q9. Write the value of n after execution:

char ch = ‘d’;

int n = ch + 5;

Q10. Name the following:

(a) What is an instance of the class called?


(b) The method which has same name as that of the class name.

4 nos Question out of 6 credit [15] Marks = Total 60 Marks

Q1. Write a program to accept a list of 20 integers. Sort the first 10 numbers in
ascending order and next the 10 numbers in descending order by using ‘Bubble Sort’
technique. Finally, print the complete list of integers.

Q2. Design a class to accept a string (one word) and convert it into uppercase. Now
check and print if it is a ‘No vowel’ word or not. A word is a ‘No vowel’ word, if it does
not contain any vowel in it.

Input: rhythm
Output: RHYTHM
No Vowel word

Q3. Create a class with one integer instance variable.

Initialize the variable using :


(i) default constructor.
(ii) parameterized constructor.

Q4. Write a class with name employee and basic as its data member, to find the
gross pay of an employee of the following allowances and deduction. Use
meaningful variable.

Dearness Allowance = 25% of Basic pay House Rent Allowance = 15% of Basic pay
Provident Fund = 8.33% of Basic Pay
Net Pay = Basic Pay + Dearness Allowance + House Rent Allowance
Gross Pay = Net Pay – Provident fund

Q5. Define a class to overload the function print as follows:


void print() to print the following format
1111
2222
3333
4444
5555
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.
Q6. Define a class to accept 10 characters from a user. Using bubble sort technique
arrange them in ascending order. Display the sorted array and original array.

You might also like