Computer Applications ICSE Sample Paper 3
Computer Applications ICSE Sample Paper 3
SAMPLE PAPER 3
COMPUTER APPLICATIONS
(Theory)
(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.
This time is to be spent in reading the question paper.
The time given at the head of this Paper is the time allowed for writing the answers.
This Paper is divided into two Sections.
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 brackets [ ].
(c)
(d)
(e)
[2]
[2]
[2]
[2]
[2]
Question 2.
(a)
[4]
String s1 = "TRANSITION";
String s2 = "MOCK TEST";
(i)
(ii)
(iii)
(iv)
System.out.println(s1.substring(0,3).concat(s2.substring(5));
System.out.println((int)s2.charAt(6));
System.out.println(s1.replace('T','F'));
System.out.println(s1.charAt(s1.indexOf('R')+s2.indexOf('T')));
www.javaforschool.com
Turn over
SAMPLE PAPER 3
[2]
(d)
What is the size in the memory required to store 15 elements in an Array A[] when:
(i)
A[] is of long data type
(ii)
A[] is of character data type
[2]
Question 3.
(a)
[2]
(b)
What are packages? Write the Java statement for importing a package named 'happy'.
[2]
(c)
(d)
(e)
.
What is the advantage of the call by value method over call by reference ?
[1]
[2]
State the output of the below function when m=36, n=54? What is the method computing? [3]
void calc(int m, int n)
{
while(n!=m)
{
if(n>m)
n=n-m;
else
m=m-n;
}
System.out.println("Output = "+n);
}
Question 4.
(a)
[4]
2
TSP003
www.javaforschool.com
SAMPLE PAPER 3
[2]
(c)
[2]
(d)
Write the function "check" which takes two integer arguments (x,y) and returns 'true'
if x>y otherwise returns 'false'
[2]
Stream
90
80
70
60
and above
89
79
69
Write a program to declare the class 'Student' and calculate the average of every student and the
stream assigned to them. Display the result in the format given below:
Name
..
..
Roll No.
Total Marks
..
..
Average
Stream
[15]
Question 6.
Write a program in Java to accept the name and contact numbers of 25 people. The program
should ask the user for a contact number and search for it in the contact numbers array using
the Binary Search technique. If the number is found, then the corresponding name is displayed
otherwise a proper error message is displayed.
[15]
3
TSP003
www.javaforschool.com
Turn over
SAMPLE PAPER 3
Input an integer number and print the greatest and the smallest digits present in the number.
Example:
Input: n=2943
Output: Greatest digit = 9 and Smallest digit = 2
(b)
Input a line of text from the user and create a new word formed out of the first letter of each
word and convert the new word into Uppercase.
Example:
Input: Mangoes are delivered after Midday
Output: MADAM
[15]
Question 8.
The sum of two distances is calculated as:
Distance 1 =
10 feets
24 inches
Distance 2 =
5 feets
16 inches
Sum of Distances = 18 feets
4 inches
A class Distance has the following members:
Class Name
Data members
:
:
Member methods
:
:
:
Distance
f1,f2 (integers to store the feet value of 2 distances)
inc1,inc2 (integers to store the inch value of 2 distances)
Write a program in Java to input two distances and calculate their sum by applying proper
adjustments. Display the final result with appropriate message. [Given 1 feet = 12 inches]
[15]
Question 9.
Design a class to overload a function printSeries( ) as follows:
(a) void printSeries(int) to compute the series:
[15]
+ +
[15]
4
TSP003
www.javaforschool.com
SAMPLE PAPER 3
HiArm
:
:
Member functions/methods
HiArm ( )
HiArm (int a)
int sumArm (int)
void isArm ( )
:
:
:
:
:
constructor to assign 0 to n
constructor to assign a to n
to find and return the sum of cube of digits of a number
to invoke sumArm ( ) and print whether the number is
Armstrong or not
Then write the main( ) method to input a number and call the above functions as required to check
whether it is an Armstrong number or not.
[Note: An Armstrong number is a number which is equal to the sum of the cube of its digits.
Example of an Armstrong Number is 153 = 13+53+33 = 153]
[15]
5
TSP003
www.javaforschool.com
Turn over