Computer Applications — Suggested Paper 5
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). JAVA code is:
[1 mark]- (a)Compiled and interpreted
- (b)Only compiled
- (c)Only Interpreted
- (d)Translated
1(ii). The absence of which statement leads to fall through situation in switch case statement?
[1 mark]- (a)continue
- (b)break
- (c)return
- (d)System.exit(0)
1(iii). Fill in blank (i): import java.__________.*;
[1 mark]- (a)utility
- (b)Util
- (c)util
- (d)UTILITY
1(iv). Which of the following String methods returns a negative value?
[1 mark]- (a)length()
- (b)equals()
- (c)compareTo()
- (d)charAt()
1(v). A method which does not modify the value of variables is termed as:
[1 mark]- (a)Impure method
- (b)Pure method
- (c)Primitive method
- (d)User defined method
1(vi). Which of the following is user defined data type? 1. array 2. double 3. class 4. boolean
[1 mark]
- (a)only 1
- (b)1 and 3
- (c)only 2
- (d)only 4
1(vii). A __________ method needs to be called with the help of an object.
[1 mark]- (a)void
- (b)class
- (c)non-static
- (d)static
1(viii). The full form of JVM is:
[1 mark]- (a)Java Visual Machine
- (b)Joint Vision Mechanism
- (c)Java Virtual Machine
- (d)Java virtual mechanism
1(ix). Assertion (A): In switch case break statement avoids fall through. Reason (R): break statement helps to execute only one case at a time.
[1 mark]- (a)Both (A) and (R) are true and (R) is a correct explanation of (A).
- (b)Both (A) and (R) are true and (R) is not a correct explanation of (A).
- (c)(A) is true and (R) is false.
- (d)(A) is false and (R) is true.
1(x). Which of the following mathematical methods returns only an integer?
[1 mark]- (a)Math.ceil(n)
- (b)Math.sqrt(n)
- (c)Math.floor(n)
- (d)Math.round(n)
1(xi). The output of the statement "talent".compareTo("genius") is __________.
[1 mark]- (a)11
- (b)-11
- (c)0
- (d)13
1(xii). Parameters used in the method call statement are __________.
[1 mark]- (a)Actual parameters
- (b)Informal parameters
- (c)Formal parameters
- (d)Void parameters
1(xiii). Consider the following statements: Computer desktop = new Computer(); Computer Mainframe = new Computer(); Name the objects of the class given above:
[1 mark]- (a)Desktop, Mainframe
- (b)desktop, Mainframe
- (c)Computer, Mainframe
- (d)Computer, desktop
1(xiv). The output of 42/6%2 is:
[1 mark]- (a)1
- (b)10
- (c)2
- (d)0
1(xv). Give the output of the following: int f = 10, m = 9; String e = (m % f == 9) ? "YES" : "NO"; System.out.print(e);
[1 mark]- (a)YES
- (b)NO
- (c)YESNO
- (d)NOYES
1(xvi). When an object of a Wrapper class is converted to its corresponding primitive data type, it is called as __________.
[1 mark]- (a)Boxing
- (b)Explicit type conversion
- (c)Unboxing
- (d)Implicit type conversion
1(xvii). Give the output of the following String methods: "SUCCESS".indexOf('S') + "SUCCESS".lastIndexOf('S')
[1 mark]- (a)0
- (b)5
- (c)6
- (d)-5
1(xviii). Method which reverses a given number is __________:
[1 mark]- (a)Impure method
- (b)Pure method
- (c)Constructor
- (d)Destructor
1(xix). The full form of JVM is:
[1 mark]- (a)Java Visible Machine
- (b)Java Virtual Mode
- (c)Java Virtual Machine
- (d)Java Visible Mode
1(xx). Fill in blank (v): for( __________ ; x <= ... ; x += 0.5)
[1 mark]- (a)double x = 0.5
- (b)Double x = 0.5
- (c)double x = 0.0
- (d)Double x = 0.0
2(i). (i) int res = 'A'; What is the value of res? (ii) Name the package that contains wrapper classes.
[2 marks]2(ii). String x[] = {"Artificial intelligence", "IOT", "Machine learning", "Big data"}; Give the output of the following statements: (i) System.out.println(x[3]); (ii) System.out.println(x.length);
[2 marks]2(v). Write the return data type of the following functions: (i) startsWith() (ii) random()
[2 marks]2(ix). Give the output of the following: Math.sqrt(Math.max(9, 16))
[2 marks]2(x). Evaluate the following expression if the value of x = 2, y = 3 and z = 1. v = x + --z + y++ + y;
[2 marks]2(iii). Give the output of the following program segment and mention how many times the loop will execute: int k; for(k = 5; k <= 20; k += 7) if(k % 6 == 0) continue; System.out.println(k);
[2 marks]2(iv). Write the Java statement for creating an object named 'sifra' of the class 'Robot', which takes three double parameters.
[2 marks]2(vi). (a) Name one String method which results in positive integer only. (b) Name one String method which results in a character.
[2 marks]2(vii). Name the type of error (syntax, runtime or logical error) in each case given below: (i) Math.sqrt(36 - 45) (ii) int a; b; c;
[2 marks]2(viii). String x[] = {"SAMSUNG", "NOKIA", "SONY", "MICROMAX", "BLACKBERRY"}; Give the output of the following statements: (i) System.out.println(x[1]); (ii) System.out.println(x[3].length());
[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. DTDC, a courier company, charges for the courier based on the weight of the parcel. Define a class with the following specifications: class name: courier Member variables: name - name of the customer weight - weight of the parcel in kilograms address - address of the recipient bill - amount to be paid type - 'D' domestic, 'I' international Member methods: void accept() - to accept the details using the methods of the Scanner class only. void calculate() - to calculate the bill as per the following criteria: Weight in Kgs Rate per Kg First 5 Kgs Rs. 800 Next 5 Kgs Rs. 700 Above 10 Kgs Rs. 500 An additional amount of Rs. 1500 is charged if the type of the courier is I (International) void print() - To print the details void main() - to create an object of the class and invoke the methods
[15 marks]4. Using the switch-case statement, write a menu-driven program to do the following: (a) To generate and print letters from A to Z and their Unicode: Letters Unicode A 65 B 66 ... Z 90 (b) Display the following pattern using an iteration (looping) statement: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
[15 marks]5. Write a program in Java to accept a string in lowercase and change the first letter of every word to uppercase. Display the new string. Sample input: we are in cyber world Sample Output: We Are In Cyber World
[15 marks]6. Design a class to overload a function series() as follows: (a) void series(int x, int n) - to display the sum of the series given below: x^1 + x^2 + x^3 + ... to n terms (b) void series(int p) - to display the following series: 0, 7, 26, 63, ... to p terms (c) void series() - to display the sum of the series: 1/2 + 1/3 + 1/4 + ... + 1/10
[15 marks]
7. Define a class named StepTracker with the following specifications: Member Variables: String name - stores the user’s name. int sw - stores the total number of steps walked by the user. double cb - stores the estimated calories burned by the user. double km - stores the estimated distance walked in kilometers. Member Methods: void accept() - to input the name and the steps walked using Scanner class methods only. void calculate() - calculates calories burned and distance in km based on steps walked using the following estimation table: Calories Burned : steps walked x 0.04 (e.g. 1 step burns 0.04 calories) Distance (Km) : steps walked / 1300 (e.g. 1300 steps is approx. 1 km) void display() - Display the calories burned, distance in km and the user’s name. Write a main method to create an object of the class and invoke the methods.
[15 marks]8. Write a program to initialize the seven wonders of the world along with their locations in two different arrays. Search for the name of a country input by the user. If found, display the name of the country along with its wonder, otherwise display "Sorry not found!". Seven wonders: CHICHEN ITZA, CHRIST THE REDEEMER, TAJ MAHAL, GREAT WALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM Locations: MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY Example: Country name: INDIA Output: INDIA - TAJ MAHAL Country name: USA Output: Sorry not found!
[15 marks]