Computer Applications ICSE Sample Paper 5
Computer Applications ICSE Sample Paper 5
SAMPLE PAPER 5
COMPUTER APPLICATIONS
(THEORY)
(Two hours)
(Full Marks 100)
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 [ ].
[2]
[1]
[2]
[2]
[3]
Question 2.
(a)
(b)
(c)
(d)
[2]
[2]
[2]
[4]
class Sample {
public void main [ ] ; {
x=2
y = 2.2;
float z = x * y;
System.out.printline("Value of x++ = " (x++)
system.out.println("Value of z = " + z)
}
}
www.javaforschool.com
Turn over
SAMPLE PAPER 5
[3]
(b)
(c)
What is a constructor?
State whether the following are true or false:
(i)
"After creating an array the size cannot be altered"
(ii)
"int arr [ ] and int [ ] arr are both valid declarations"
Write a statement for each of the following:
(i)
Store a number 354 as a String.
(ii)
Convert the String to a numeric value.
(iii)
Add it to the existing total of 1000 to update the total.
[2]
[2]
(d)
[3]
Question 4.
(a)
(b)
[2]
[2]
(c)
What is the difference between a break statement and a continue statement when
they occur in a loop?
ut + ft
(d)
(e)
[2]
[2]
[2]
void whyPattern()
{
for(int i=?1?; i<?2?;i++)
{
for(int j=1;j<=?3?;j++)
{
System.out.print(?4?+" ");
}
System.out.println();
}
}
2
TSP005
www.javaforschool.com
SAMPLE PAPER 5
Where P - is the Principal amount, r rate of interest and t time period in years.
Data members of class : pamt, rate (double data type to store principal amount and rate of
interest), time (integer to store time period)
Functions of the class :
(i)
(ii)
(iii)
(iv)
Write a main function to input required data and by invoking suitable functions print the
entered data and compound interest.
[15]
Question 6.
A hotel is giving seasonal discount on the total amount to be paid by the person staying at the
time of check out. The charges for one day stay is `850.0 per room. The discount will be given as
per the following criteria:
Number of days stayed
Upto 5 days
> 5 days and <= 10 days
> 10 days and <= 20 days
More than 20 days
Write a program to input name of guest, total number of days stayed in the hotel.
Calculate the total amount to be paid and discount amount. Find the net balance to be paid
excluding the discount. Print the bill including all the data.
[15]
Question 7.
Write a program in Java to print all the ARMSTRONG numbers in the range between m and n
(both inclusive). The input contains two positive integers m and n, where m<n and m<3000 and
n<3000.
[Note: An Armstrong number is a number which is equal to the sum of the cube of its digits]
[15]
3
TSP005
www.javaforschool.com
Turn over
SAMPLE PAPER 5
S=
(b)
n terms
Input an integer and print the sum of first and last digits of that number.
Example:
Input
:
n = 8452
Output
:
Sum of first and last digit = 8+2 = 10
Question 9.
(a)
(b)
Write a program to accept a String. Convert the string to Uppercase. Count and output
the number of double letter sequences that exist in the string.
Sample Input
:
"SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE"
Sample Output
:
4
[7]
Write a program to accept a String and convert its into its Piglatin form.
To translate word into a Piglatin word, convert the word into Uppercase and then place
the first vowel of the original word as the start of the new word along with the remaining
alphabets. The alphabets present before the vowel being shifted towards the end followed
by "AY".
Sample Input (1) : London,
Sample Output (1) : ONDONLAY
Sample Input (2) : Olympics,
Sample Output (2) : OLYMPICSAY
[8]
Question 10.
Write a menu driven program to generate a triangle or a pyramid based upon the users choice:
(a)
A
AB
ABC
ABCD
ABCDE
(b)
B
C C C
D D D D
E E E E E
Example 1:
Input:
Output:
A
B
Example 2:
Type 1 for a Triangle or
Type 2 for a Pyramid: 1
A
AB
ABC
ABCD
ABCDE
Input:
Output:
[15]
4
TSP005
www.javaforschool.com