Computer Applications — Suggested Paper 3
150 minutes100 marks Questions from 2016–2026
A suggested paper: every question is a real ICSE board question, chosen from different years and arranged in the current pattern. Start the timed test to have your written answers marked.
Section A (40 marks)
Attempt all questions from this Section.
1. Choose the correct answers to the questions from the given options. (Do not copy the questions, write the correct answers only.)
1(i). Fill in blank (iii): int rem = __________
[1 mark]- (a)n % 100
- (b)n / 10;
- (c)n % 10;
- (d)n / 100
1(ii). Fill in blank (iii): if( __________ )
[1 mark]- (a)per >= 90
- (b)per <= 90
- (c)per > 90
- (d)per == 90
1(iii). The output of Math.max(-7, Math.min(-5, -4)) is
[1 mark]- (a)-5
- (b)-4
- (c)-7
- (d)error
1(iv). To extract the word NOW from the word "ACKNOWLEDGEMENT", the Java statement "ACKNOWLEDGEMENT".substring(3, ____) is used. Choose the correct number to fill in the blank.
[1 mark]- (a)6
- (b)7
- (c)5
- (d)8
1(v). Which of the following pairs of methods will cause a compile-time error due to incorrect method overloading?
[1 mark]- (a)void test(int a, int b) and void test(double a, double b)
- (b)void test(int a, double b) and void test(double a, int b)
- (c)void test(int a, double b) and void test(int a)
- (d)void test(int a) and int test(int a)
1(vi). Which of the following is true for the given object creation statement? Game cricket = new Game();
[1 mark]- (a)Game is an object of cricket class
- (b)New keyword creates object Game
- (c)Game is a class and cricket is an object
- (d)Game and cricket are objects
1(vii). A method which is a part of a class rather than an instance of the class is termed as:
[1 mark]- (a)Static method
- (b)Non static method
- (c)Wrapper class
- (d)String method
1(viii). double x[] = {2.5, 4.5, 5.5, 6.4}; occupies __________ bytes.
[1 mark]- (a)16
- (b)4
- (c)8
- (d)32
1(ix). Identify the type of operator &&:
[1 mark]- (a)ternary
- (b)unary
- (c)logical
- (d)relational
1(x). Fill in blank (i): for( __________ ; ... ; i++)
[1 mark]- (a)int i = 1
- (b)int i = 0
- (c)int i = 2
- (d)Int i = 1
1(xi). What is the output of Math.ceil(5.4) + Math.ceil(4.5)?
[1 mark]- (a)10.0
- (b)11.0
- (c)12.0
- (d)9.0
1(xii). What will be the output of the following code? System.out.println("Lucknow".substring(0, 4));
[1 mark]- (a)Lucknow
- (b)Luckn
- (c)Luck
- (d)luck
1(xiii). Invoking a method by passing the objects of a class is termed as __________.
[1 mark]- (a)Call by reference
- (b)Call by value
- (c)Call by method
- (d)Call by constructor
1(xiv). Fill in blank (vi): Student s = new __________
[1 mark]- (a)Student();
- (b)STUDENT()
- (c)student()
- (d)Student()
1(xv). Post office is an example for __________ access specifier.
[1 mark]- (a)public
- (b)local
- (c)protected
- (d)private
1(xvi). A single dimensional array contains N elements. What will be the last subscript?
[1 mark]- (a)N
- (b)N-1
- (c)N-2
- (d)N+1
1(xvii). The program code written in any high-level language to solve a problem is:
[1 mark]- (a)object code
- (b)source code
- (c)machine code
- (d)bytecode
1(xviii). Fill in blank (ii): while( __________ )
[1 mark]- (a)n < 0
- (b)n > 0
- (c)n == 0
- (d)n = 0
1(xix). The output of the statement: System.out.println(Character.toUpperCase('b') + 2); is:
[1 mark]- (a)66
- (b)100
- (c)68
- (d)98
1(xx). The output of the statement "CONCENTRATION".indexOf('T') is __________.
[1 mark]- (a)9
- (b)7
- (c)6
- (d)-1
2(i). Write the output of the following statement: System.out.println("A picture is worth \t \"A thousand words.\" ");
[2 marks]2(ii). Differentiate between boxing and unboxing.
[2 marks]2(iii). Give the output of the following expression: a += a++ + ++a + --a + a--; when a = 7
[2 marks]2(iv). Rewrite the following code using the if-else statement: int m = 400; double ch = (m > 300) ? (m / 10.0) * 2 : (m / 20.0) - 2;
[2 marks]2(v). What are the various types of errors in Java?
[2 marks]2(vi). Differentiate between searching and sorting.
[2 marks]2(viii). Define abstraction.
[2 marks]2(vii). Consider and give the output of the following program: class report { int a, b; report() { a = 10; b = 15; } report(int x, int y) { a = x; b = y; } void print() { System.out.println(a * b); } static void main() { report r = new report(); r.print(); report p = new report(4, 5); p.print(); } }
[2 marks]2(ix). Define encapsulation.
[2 marks]2(x). Give the output of the following program segment and also mention the number of times the loop is executed: int a, b; for(a = 6, b = 4; a <= 24; a = a + 6) { if(a % b == 0) break; } System.out.println(a);
[2 marks]Section B (60 marks)
Attempt 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 logic of the program is clearly depicted. Flowcharts and algorithms are not required.
3. 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 is equal to the sum of odd digits. e.g. 3669 odd digits sum = 3 + 9 = 12 even digits sum = 6 + 6 = 12 3669 is a lead number.
[15 marks]4. Define a class to accept a String and print if it is a Super String or not. A String is Super if the number of uppercase letters is equal to the number of lowercase letters. [Use Character & String methods only] Example: "COmmITmeNt" Number of Uppercase letters = 5 Number of Lowercase letters = 5 String is a Super String
[15 marks]5. Write a program to accept the name and total marks of N number of students in two single subscript arrays name[] and totalMarks[]. Calculate and print: (i) The average of the total marks obtained by N number of students. [average = (sum of total marks of all the students) / N] (ii) Deviation of each student’s total marks with the average. [deviation = total marks of a student - average]
[15 marks]6. Define a class named CloudStorage with the following specifications: Member Variables: int acno - stores the user’s account number. int space - stores the amount of storage space in GB purchased by the user. double bill - stores the total price to be paid by the user. Member Methods: void accept() - prompts the user to input their account number and storage space using Scanner class methods only. void calculate() - calculates the total price based on the storage space purchased using the pricing table provided: Storage range Price per GB (Rs) First 15 GB 15 Next 15 GB 13 Above 30 GB 11 void display() - displays the account number, storage space and bill to be paid. Write a main method to create an object of the class and invoke the methods of the class with respect to the object.
[15 marks]
7. Define a class named BookFair with the following description: Instance variables / data members: String bName - stores the name of the book double price - stores the price of the book Member functions: BookFair() - default constructor to initialize data members void input() - to input and store the name and the price of the book void calculate()- to calculate the price after discount. Discount is calculated based on the following criteria: Price Discount Less than or equal to Rs. 1000 2% of price More than 1000 and up to Rs. 3000 10% of price More than Rs. 3000 15% of price void display() - to display the name and price of the book after discount Write a main() method to create an object of the class and call the above methods.
[15 marks]8. Write a program to input forty words in an array. Arrange these words in descending order of alphabets, using the selection sort technique. Print the sorted array.
[15 marks]