ICSE Computer Applications – 2008
COMPUTER APPLICATIONS
(Two Hours)
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during the first 15 minutes.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in bracket [ ]
SECTION – A (40 Marks)
Question 1.
(a) Mention any two attributes required for class declaration. [2]
(b) State the difference between token and identifier. [2]
(c) Explain instance variable. Give an example. [2]
(d) What is inheritance and how is it useful in Java. [2]
(e) Explain any two types of access specifier. [2]
Question 2.
(a) What is meant by an infinite loop ? Give one example. [2]
(b) State the difference between = = operator and equals( ) method . [2]
(c) Differentiate between actual parameter and formal parameter. [2]
(d) What is the use of exception handling in Java. [2]
(e) Differentiate between base and derived class. [[2]
Question 3
(a) Explain the function of each of the following with an example : [2]
(i) break;
(ii) continue;
(b) Convert the following segment into equivalence for loop. [2]
int i, i=0;
while(i<=20)
[Link](i+” “);
l++;
(c) If a = 5, b = 9 calculate the value of : [2]
a+ = a++-++b+a
(d) Give the output of the following expressions. [2]
(i) If x = -9.99, calculate [Link](x);
(ii) If x = 9.0, calculate [Link](x);
(e) If, String x = “Computer”; [4]
String y = “Applications”;
What do the following functions return for:
(i) [Link] ([Link](1,5));
(ii) System [Link] ([Link]([Link](4)));
(iii) [Link] (y+[Link](5)));
(iv) [Link] ([Link](y)));
(f) If, array [ ] = {1,9,8,5,2}; [2]
(i) What is array length( )?
(ii) What is array [2]
(g) What does the following mean ? [2]
Employee stuff = new Employee( )
(h) Write a Java statement to input / read the following from the user using the keyboard. [2]
(i) Character (ii) String
SECTION – B (60 Marks)
Attempt any four questions from this Section.
Question 4.
Define a class Employee having the following description : [15]
Instance variables :
int pan to store personal account number
String name to store name
double tax income to store annual taxable income
double tax to store tax that is calculated
Member functions :
input ( ) Store the pan number, name, taxable income
calc( ) Calculate tax for an employee
display ( ) Output details of an employee
Write a program to compute the tax according to the given conditions and display the output as per given format.
Total Annual Taxable Income Tax Rate
Upto Rs, 1,00,000 No tax
From 1,00,001 to 1,50,000 10% of the income exceeding Rs. 1,00,000
From 1,50,001 to 2,50,000 Rs. 5000 + 20% of the income exceeding Rs. 1,50,000
Above Rs. 2,50,000 Rs. 25,000 + 30% of the income exceeding Rs. 2,50,000
Output :
Pan Number Name Tax-income Tax
__ __ __ __
__ __ __ __
__ __ __ __
Question 5
Write a program to input a string and print out the text with the uppercase and lowercase letters reversed, but all
other characters should remain the same as before. [15]
Example :
INPUT : WelComE TO School
OUTPUT : wELcOMe to sCHOOL
Question 6
Define a class and store the given city names in a single dimensional array. Sort these names in alphabetical order
using the Bubble Sort technique only. [15]
INPUT : Delhi,Bangalore,Agra, Mumbai,Calcutta
OUTPUT : Agra,Bangalore,Calcutta,Delhi, Mumbai
Question 7
Write a menu driven class to accept a number from the user and check whether it is a palindrome or a Perfect
number. [15]
(a) Palindrome number :
(a number is a Palindrome which when read in reverse order is same as read in the right order)
Example : 11, 101, 151 etc.
(b) Perfect number :
(a number is called Perfect if it is equal to the sum of its factors other than the number itself)
Example : 6 = 1 + 2 + 3
Question 8.
Write a class with the name volume using function overloading that computes the volume of a cube, a sphere and
a cuboid. [15]
Formula :
volume of a cube (vc) = s*s*s
volume of a sphere (vs) = 4/3 * pi * r * r * r
(where pi = 3.14 or 22/7)
Volume of a cuboid (vcd) = l * b * h
Question 9
Write a program to calculate and print the sum of each of the following series: [15]
(a) Sum (S) = 2 – 4 + 6 – 8 + ………. -20
(b) Sum (S) = x + x + x + x + ………….. + x
2 5 8 11 20
(Value of x to be input by the user. )