0% found this document useful (1 vote)
3K views22 pages

Question Bank MCQ Computer Class 10

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 (1 vote)
3K views22 pages

Question Bank MCQ Computer Class 10

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/ 22

Computer Applications ICSE – Class X

COMPETENCY-FOCUSED PRACTICE QUESTIONS

ICSE - CLASS X

Computer Applications

I: Multiple Choice Questions (1 mark)

S.No Questions
1. [User Defined Methods]
What is the type of error, if any, when two methods have the same method signature?
(a) Runtime error
(b) Logical error
(c) Syntax error
(d) No error [Understanding]

2. [User Defined Methods]


The advantage/s of user-defined methods are/is:
(i) Reusability
(ii) Complexity
(iii) Modularity

(a) Only (i)


(b) (ii) and (iiii)
(c) Only (iiii)
(d) (i) and (iii) [Understanding]

3. [User Defined Methods]


Parameters which receive the values from the called method are termed as _______
parameters.
(a) actual
(b) formal
(c) reference
(d) class [Understanding]

ICSE Competency-Focused Practice Questions 2


Computer Applications ICSE – Class X

S.No Questions
4. [User Defined Methods]
Which of the following is a valid method prototype?
(a) public int perform (int a;int b)
(b) public perform (int a, int b)
(c) public int perform (int a, int b)
(d) public perform int (int a, int b) [Analysis]

5. [User Defined Methods]


Which of the following is the CORRECT statement to invoke the method with the
prototype int display(int a, char ch)?
(a) int m = display(‘A’, 45);
(b) int m = display( );
(c) int m = display(A,45);
(d) int m = display(45,‘A’); [Analysis]

6. [String handling]
Which of the following is the CORRECT java statement to convert the word
RESPECT to lowercase?
(a) “RESPECT”. tolowercase( );
(b) ”RESPECT”.toLowerCase( );
(c) toLowerCase(“RESPECT”);
(d) String. toLowerCase(“RESPECT”); [Analysis]

7. [Library Classes]
Which of the following are Wrapper classes?
(i) Boolean
(ii) boolean
(iii) character
(iv) Character

(a) (i) and ((iv)


(b) (ii) and (iv)
(c) (i) and (iii)
(d) (ii) and (iii) [Understanding]

8. [Library Classes]
Conversion of a wrapper class to its corresponding primitive type is known as :
(a) unboxing
(b) autoboxing
(c) type casting
(d) parsing [Understanding]

ICSE Competency-Focused Practice Questions 3


Computer Applications ICSE – Class X

S.No Questions
9. [String Handling]
The String method, which results only in a positive integer, is :
(a) indexOf
(b) lastIndexOf
(c) compareTo
(d) length [Understanding]

10. [Library Classes]


The method to convert a String to double is:
(a) String. toDouble()
(b) Double. Parsedouble()
(c) Double. parseDouble(String)
(d) Double. parseDouble( ) [Understanding]

11. [Arrays]
The java statement System. out. println(x[x. length]) results in:
(a) logical error
(b) syntax error
(c) run time error
(d) no error [Analysis]

12. [Arrays]
Which of the following is a valid array declaration statement to store the Gender of 80
employees [ ‘M’-male, ‘F’-female, ‘T’-transgender ]?
(a) char gender = new char[80];
(b) char gender[] = new char[80];
(c) char gender[80];
(d) char gender[80] = new char[ ]; [Analysis]

13. [Arrays]
Arrange the following java statements in the correct order of execution to accept values
into the array a[]:
(i) a[i]=sc. nextInt( );
(ii) int a[]=new int[10];
(iii) Scanner sc=new Scanner(System. in);
(iv) for(i=0;i<10;i++)

(a) (i), (ii), (iii), (iv)


(b) (ii), (iii), (iv), (i)
(c) (iv), (iii), (ii), (i)
(d) (iii), (i), (iv), (ii) [Analysis]

ICSE Competency-Focused Practice Questions 4


Computer Applications ICSE – Class X

S.No Questions
14. [Arrays]
In the bubble sort technique, during each iteration of the inner loop, two adjacent
elements are __________and __________.
(i) compared
(ii) swapped
(iii) selected
(iv) deleted

(a) (i) and (ii)


(b) (ii) and (iii)
(c) (iii) and (iv)
(d) (ii) and (iv) [Understanding]

15. [Arrays]
What is the highest index of any array with 100 elements?
(a) 100
(b) 101
(c) 99
(d) 98 [Recall]

16. [User Defined Methods]


Mr. Sanjay is an event manager, he plans and allots duties to each of his subordinates
to handle different events. In a program, a task is divided into simple methods. Name
the feature used in these contexts.
(a) Complexity
(b) Modularity
(c) Reusability
(d) Monolithic [Understanding & Analysis]

17. [Input in Java]


Raj was asked to accept the phone number which has 10 digits, using the appropriate
method of Scanner class. Which of the following statement he must choose?
(a) Ob. nextInt()
(b) Ob. nextDouble()
(c) Ob. nextLong()
(d) Ob. next().chatAt(0) [Analysis]

18. [String Handling]


Raj wanted to count the number of digits in a given number without using a loop.
Which of the following statements is correct to perform the above?
(a) String.valueOf(n).length()
(b) Integer.parseInt(n).length()
(c) n.length()
(d) All the above [Analysis]

ICSE Competency-Focused Practice Questions 5


Computer Applications ICSE – Class X

S.No Questions
19. [String Handling]
Sham was asked to encode a string S, by replacing the letter E with #. Select the
appropriate statement:
(a) S.replace(‘#’,’E’)
(b) S. replace(‘E’)
(c) S. replace(‘E’, ‘#’)
(d) S. replace(‘#’) [Analysis]

20. [String Handling]


When the String m is compared to n , the result obtained is greater than zero. Which
of the following is true?
(a) m comes before n in the dictionary.
(b) n comes before m in the dictionary.
(c) m and n are equal.
(d) m and n have the same length.
[Analysis]

21 [String Handling]
Which of the following String methods has integer argument?
(i) length
(ii) substring
(iii) indexOf
(iv) charAt

(a) Only (ii)


(b) (i) and (iv)
(c) (ii) and (iv)
(d) (iii) and (iii) [Analysis]

22. [Introduction to Object-Oriented Programming Concepts]


Assertion: Property by virtue of which one class acquires the properties of another
class is termed as Inheritance.
Reason: Inheritance promotes reusability.
(a) Assertion is true, Reason is false.
(b) Assertion is true, Reason is true.
(c) Assertion is false, Reason is false.
(d) Assertion is false, Reason is true. [Understanding]

23. [User Defined Methods]


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. [Analysis]

ICSE Competency-Focused Practice Questions 6


Computer Applications ICSE – Class X

S.No Questions
24. [Values and Datatypes]
Which of the following is a valid initialisation statement?
(a) int x = “GOOD”;
(b) int y = 45.0/2;
(c) int z=(int) ‘x’;
(d) int m = false ; [Analysis]

25. [Values and Datatypes]


Which of the following is a valid statement to print the following sentence:
Raj said “Good morning”
(a) System. out. println(“Raj said “Good morning”);
(b) System. out. println(“Raj said \\Good morning\\);
(c) System. out. println(“Raj said \"Good morning\" ”);
(d) System. out. println(“Raj said Good morning”); [Analysis]

26. [Arrays]

Which data structure is represented in the above picture?


(i) A two-dimensional array with 2 rows and seven columns.
(ii) A one-dimensional array with 14 elements.

(a) Both (i) and (ii)


(b) Only (i)
(c) Only (ii)
(d) None of the (i) and (ii) [Application & Analysis]

ICSE Competency-Focused Practice Questions 7


Computer Applications ICSE – Class X

S.No Questions
27. [Iterative Constructs in Java]

What is the type of looping statement depicted in the above picture?


(a) Entry controlled loop
(b) Exit controlled loop
(c) Multiple branching statement
(d) All the above. [Understanding & Application]

28. [Arrays]

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. [Understanding & Application]

ICSE Competency-Focused Practice Questions 8


Computer Applications ICSE – Class X

S.No Questions
29. [Arrays]

Name the method of search depicted in the above picture.


(a) Binary Search
(b) Selection Sort
(c) Bubble Sort
(d) Linear Search [Understanding & Application]

30. [User Defined Methods]

Name the feature of Java depicted in the above picture.


(a) Encapsulation
(b) Inheritance
(c) Polymorphism
(d) Data abstraction [Recall & Understanding]

ICSE Competency-Focused Practice Questions 9


Computer Applications ICSE – Class X

S.No Questions
31. [Values and Datatypes]

Name the data types in order from top, given in the above picture.
(a) int, char, double, String
(b) String, int, char, double
(c) char, double, int, String
(d) int, double, char, String [Understanding]

32. [Arrays]

How many bytes are occupied by the above two-dimensional array?


(a) 96 bytes
(b) 128 bytes
(c) 12 bytes
(d) 24 bytes [Understanding]

33. [Java Expressions]


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 [Analysis]

ICSE Competency-Focused Practice Questions 10


Computer Applications ICSE – Class X

S.No Questions
34. [Arrays]
The sum of a[1] and a[3] in the array int a[]={20,40,60,80,100} is:
(a) 80
(b) 100
(c) 120
(d) 60 [Evaluate]

35. [Encapsulation]

State which access specifier is less restrictive.


(a) private
(b) protected
(c) default
(d) public [Recall]

36. [Mathematical Library Methods]


The AMB hotel gives the amount to be paid by the customer as an integer, which of
the following Math method rounds off the bill in decimals to an integer?
(a) Math.round()
(b) Math.pow()
(c) Math.ceil()
(d) Math.abs() [Recall & Understanding]

ICSE Competency-Focused Practice Questions 11


Computer Applications ICSE – Class X

S.No Questions
37. [Iterative Constructs in Java]
Identify which of the following leads to an infinite loop.
(a) for(i=10;i!=0;i- -)
(b) for(i=3;i<=30;i+=3)
(c) for(i=1;i>=1;i++)
(d) for(i=1;i>=0;i- -) [Analysis]

38. [Constructors]
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 false.
(c) Both assertion and Reason are true.
(d) Assertion is false, Reason is true. [Understanding & Analysis]

39. [Arrays]
Assertion: An array can store elements of different data types
Reason: An array is a user-defined data type with multiple values of the same data
type but a different memory index.
(a) Assertion is true, Reason is false.
(b) Both Assertion and Reason are false.
(c) Both Assertion and Reason are true.
(d) Assertion is false, Reason is true. [Analysis]

40. [Values and Datatypes]


Which of the following statement is an example for explicit typecasting?
(a) int amount = 45;
(b) int amount = 24*24;;
(c) int amount = Integer.parseInt (“45”);
(d) int amount = int (45.75); [Analysis]

41. [Mathematical Library Methods]


The output of the statement Math.ceil. (89.9)+Math.floor(90.5) is:
(a) 0.0
(b) 180
(c) 180.0
(d) 180.4 [Analysis]

ICSE Competency-Focused Practice Questions 12


Computer Applications ICSE – Class X

S.No Questions
42. [String Handling]
The output of the statement of “TIGER”. indexOf(‘G’) is:
(a) 3
(b) 2
(c) -1
(d) 0 [Understanding]

43. [Conditional Constructs in Java]


Choose the statement which is equivalent to the given:
if(a>b)
System.out. println(“Honest”);
else
System.out.println(“Sincere”);
(a) a>b? System.out. println(“Honest”):System.out.println(“Sincere”);
(b) System.out.println(a>b? “Honest”: “Sincere”);
(c) a>b? “Honest”: “Sincere”;
(d) a>b: “Honest”? “Sincere”; [Understanding]

44. [String Handling]


The two Java statement are used to check for the equality of the strings “COP” and
“cop” are as follows:
“COP”. equals(“cop”)
“COP”. equalsIgnoreCase(“cop”)
The output of the above statements is:
(a) false, true
(b) true, false
(c) false, false
(d) true, true [Understanding]

45. [String Handling]


The output of the java statement “SOLDIER”. compareTo(“SOLUTE”); is
(a) -4
(b) -17
(c) 17
(d) 0 [Application]

ICSE Competency-Focused Practice Questions 13


Computer Applications ICSE – Class X

S.No Questions
46 [Arrays]
Arrange the following in the descending order of number of bytes occupied.
(i) char x[20]
(ii) int a[4][2]
(iii) double b[6]

(a) (iii), (ii), (i)


(b) (iii), (i), (ii)
(c) (ii), (iii), (i)
(d) (i), (ii), (iii) [Analysis]

47. [Arrays]
Sam performs bubble sort on the following array to organise the elements in ascending
order:
{5,1,2,3}
After the first comparison the array is:
{1,5,2,3}
What would be the array after the next comparison?
(a) {1,2,5,3}
(b) {1,5,3,2}
(c) {1,3,5,2}
(d) {1,3,2,5} [Understanding & Analysis]

Very Short Answer Questions (2 marks)

S.No Questions
48 [Mathematical Library Methods]
Write the java statement for:
Sum of a raised to b and cuberoot of c [Understanding]

49. [User Defined Methods]


Name the following:
(a) Method with the same name as of the class and is invoked every time an object is
created.
(b) Keyword to access the classes of a package. [Understanding]

ICSE Competency-Focused Practice Questions 14


Computer Applications ICSE – Class X

S.No Questions
50. [Library Classes]
Name the following:
(a) A Character method that checks whether a character is an alphabet or a number.
(b) A Math method that does not have an argument. [Understanding]

51. [String Handling]


Cyber police wanted to investigate a case; they wanted to check a list of phone numbers
that had 945 anywhere in the phone number. Example: 7394567938, 7685483945.., a
method was created to convert the phone number in long data type to a string and check
for the existence of the number 945. Fill in the blanks (a) and (b) in the given method
with appropriate Java statements:
void check(long pno)
{ String s = _______(a)_________;
if(______(b)_______)
System. out.println(pno);
} [Analysis]

52. [String Handling]


A manager wants to check the number of employees with names ending with KUMAR,
and fill in the blanks in the given program segment with appropriate Java statements:
void count(String s[])
{
int i, l=_________, c=0;
for(i=0;i<l;i++)
{
if(________________)
c++;
}
System.out.println(c);
} [Application]

53. [String Handling]


The output of a program which extracts a part of the string “COMPASSION” is as
follows:
(a) “PASS”
(b) “PASSION”
Write appropriate Java statements to get the above outputs. [Application]

ICSE Competency-Focused Practice Questions 15


Computer Applications ICSE – Class X

S.No Questions
54. [Iterative Constructs in Java]
Give the output of the following program segment:
for(k=a;k<=a*b;k+=a)
{ if (k%b==0)
break;
}
System. out. println(k);
Give the output when a=6, b= 4. [Application]

55. [Library Classes]


Kamal wants to display only the alphabets stored in a character array. While compiling
the code, an error was displayed. Check for the statement with the error and write the
correct statement.
char arr[]={‘4’, ‘&’, ‘a’, ‘w’, ‘d’};
int i;
for(i=0;i<arr.length;i++)
{
if(Character. isLetter(arr))
System.out. println(arr);
} [Application]

56. [Values and Datatypes]


Name the type of type casting in the given statements:
(a) double m = ‘b’;
(b) char ch = (char) 68; [Understanding]

57. [Mathematical Library Methods; String Handling]


Write Java statements for the following:
(a) To assign the cube root of -343 to a variable with the appropriate datatype.
(b) To assign the position of the last occurrence of @ in the String s with the
appropriate datatype. [Understanding]

58. [Operators]
Mention the output of this code snippet:
int lives = 5;
System.out.println(lives--);
System.out.println(lives); [Analysis]

ICSE Competency-Focused Practice Questions 16


Computer Applications ICSE – Class X

S.No Questions
59. [Iterative Constructs in Java]
Convert the following for loop segment to an exit-controlled loop.
for(k=10;k>= -1;k- -)
System. out. println(k*2);
System. out. println(k*4); [Analysis]

60. [Arrays]
Give the output of the following program segment:
int x[]={2,45,7,67,12,3};
int i, t=0;
for(i=0, t=5;i<3;i++,t- -)
{
System. out. println(x[i]+x[t];
} [Analysis]

61. [Arrays]
Write Java statements for the following:
(a) Initialise the array with the three favourite subjects.
(b) Declare an array to store the marks in 3 subjects of 40 students. [Understanding]

62. [Mathematical Library Methods]


A Student executes the given program segment and it results in 1.0, irrespective of the
value of n. State the type of the error, write the correct statement:
void solve(int n)
{ double power=Math. pow(n, ⅔);
System. out. println(power);
} [Understanding]

63. [Encapsulation]
Consider the following program segment and answer the questions given:
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?
(c) How do you correct the program if it has any error? [Analysis]

ICSE Competency-Focused Practice Questions 17


Computer Applications ICSE – Class X

S.No Questions
64. [Arrays]
Consider the array:
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? [Analysis]

65. [Evaluation of Expressions]


Evaluate the expression:
3*6%5*4/2*7%5 [Evaluate]

66. [Arrays]
Consider the following program which calculates the Norm of a matrix. Norm is square
root of sum of squares of all elements.
Fill in the blanks (a) and (b) with appropriate java statements:
double norm()
{ intx[][]={{1,5,6},{4,2,9},{6,1,3}};
int r, c, sum=0;
for(r=0;r<3;r++)
{ for( c=0;c<3;c++)
sum=sum+_____(a)_____;
}
____(b)________;
} [Analysis]

67. [Nested for Loops]


Give the output of the following program segment:
for(r=1;r<=3;r++)
{ for(c=1;c<r;c++)
{ System.out. println(r);
}
} [Analysis]

ICSE Competency-Focused Practice Questions 18


Computer Applications ICSE – Class X

S.No Questions
68. [String Handling]
Give the output of the following program segment:
void encode()
{
String s= “DICe”;
char ch;
for(i=0;i<4;i++)
{ ch=s. charAt(i);
if(“AEIOUaeiou”. indexOf(ch)>=0)
System.out. println(“@”);
else
System.out. println(ch);
} [Analysis]

69. [Arrays]
Name the following:
(a) What is the main condition to perform binary search on an array?
(b) A sort method in which consecutive elements are NOT compared.
[Understanding]
70. [Input in Java]
Answer the following:
(a) Scanner class method to accept a character.
(b) Jump statement which stops the execution of a construct. [Understanding]

71. [Iterative Constructs in Java]


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

ICSE Competency-Focused Practice Questions 19


Computer Applications ICSE – Class X

Long Answer Questions (15 marks)

S.No Questions
72. [User Defined Methods]
The BHDB company offer EMI (Equated Monthly Instalments) based loans for the
purchase of electronic devices based on the purchase amount the rate of interest is
offered as follows:
Purchase amount less than Rs.20000, rate of interest is 12% otherwise the rate of
interest is 15%.
Amount with interest for the specified number of years is calculated using the formula
Amount = p(1+r/100)^n
Where p is the purchase amount, r is the rate of interest, n is the number of years.
After the amount is calculated it is converted into EMI by dividing the amount by the
number of months of the tenure, which has to be a whole number rounded off to the
nearest integer.
Print the details as follows:
Purchase amount:
Rate of interest:
Amount with interest:
EMI:
Define a class to accept the purchase amount and the number of years of the tenure,
calculate and print the details as per the above specifications. [Application]

73. [Iterative Constructs in Java]


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
Accept a four digit number . If:
Sum of all digits= 2× ( sum of first and last)
Example: n =1234
Sum of first and last
= 1+4=5
Sum of all digits =1+2+3+4=10
Example 2
If the input value is 354, then a error message should be given as the number has only
3 digits. [Create]

ICSE Competency-Focused Practice Questions 20


Computer Applications ICSE – Class X

S.No Questions
74. [Iterative Constructs in Java; Nested for Loops]
(a) Define a class to print the Floyds triangle of given rows using nested loops only.
Example:
A Floyd triangle of 6 rows is
1
23
456
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
(b) Define a class to print the sum of the following series:
1+(1+2)+(1+2+3)+..........(1+2+3……20) [Analysis]

75. [String Handling]


A student appearing for the ICSE/ISC examination will be given an index number,
which is of the following format:
Number of 7 digits/number of 3 digits.
The first digit represents ICSE(1) or ISC(2), the next two digits represent the year, the
next four digits represent the centre number, the last 3 digits represent the index
number.
Example:
1244311/204
Class: 10
Year: 24
Centre number: 4311
Index number: 204
Example :
2259856/107
Class: 12
Year: 25
Centre number: 9856
Index number:107
Define a class to accept the student index number as a String and print his/her details
as above. [Analysis]

ICSE Competency-Focused Practice Questions 21


Computer Applications ICSE – Class X

S.No Questions
76. [Arrays]
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 [Application]

77. [User Defined Methods; Arrays; String Handling]


Define a class to overload the method that performs as follows :
void perform(int x[]) - to display the largest element of the array.
Example:
{4, 5, 16, 6, 12, 9}
Largest: 16
void perform (String s, char ch)
If ch is ‘F’ print the first 5 characters, if ch is ‘L’ print the last 5characters
Example: s= “CARPENTER”
ch = F
Output: CARPE
ch = L
Output: ENTER
void perform(int n) : to print the Product of the first and last digits of the number
Example: if n = 45326
Output: 4x6=24 [Application]

78. [User Defined Methods]


Rahul was asked to create a class with methods to calculate the area of a triangle (½ b
h ), the area of a square ( s x s), the area of a trapezium (½ h(a+b)), the area of a
rectangle (l x b). He created a class by giving the same name to all the methods as area.
Name the element of Java used in the program. Define a class with the four methods
with the same name. [Application]

ICSE Competency-Focused Practice Questions 22


Computer Applications ICSE – Class X

S.No Questions
79. [Arrays]
A teacher prepares the statistics of 100 students in ICSE 2024 on the subject Computer
Applications as follows:
Range No. Of students
Above 90
80 - 90
60 - 80
Below 60
Define a class to accept the marks of 100 students in an array and print the statistics as
mentioned above. [Application]

80. [String handling]


Sam designs a program to check the strength of a password. A strong password should
satisfy the following conditions:
→length of the password should be atleast 12 characters
→should atleast have 4 upper case letters, 4 lower case letters, 2 digits, 2 special
characters
Define a class accept the password and check whether the password is strong or not.
[Application]

ICSE Competency-Focused Practice Questions 23

You might also like