Sample paper 5 for ICSE computer
Application
SUB: COMPUTER FOR
CLASS
X
MARKS: 100
This
paper is divided into two sections. You are to answer all the questions from
section A, and any four from section B.
Section A(40 marks)
Attempt
all questions
Question 1. [2X5=10]
1. Explain
the concept of constructor overloading
2. Define
encapsulation
3. Give
the output of the following
a. String
str=”PROJECTTOR”;
System.out.println(str.indexOf(str.charAt(8));
b. String
str=”assosiation”;
int x=str.indexOf(‘s’);
System.out.println(x+str);
4. What
is the difference between a static member functions & function which are
not static?
5. Write
statement for each of the following
a. Store
a number 479 as string
b. Convert
the above string to integer
Question 2.
a. Write
statements for the following
a. To
create an object of class student
b. To
invoke a method of class student i.e find_per(int x) [2]
b.
What is the difference
between literals and identifiers [2]
c.
What are data type, name
any two with example [2]
d.
Write any two differences
in implicit & explicit type casting [2]
e.
Write a main difference
between while loop & do while loop [2]
Question 3.
a. Write true or false for the following [5]
a. &&
is relational operator
b. Float
stores 4 bytes of data
c. \n
character is used for new line
d. The
keywords are reserved words
e. JAVA
is of dual utility
b. Read
the following program and answer the questions
a. class
demo{
public void main(){
int a,b,i,j;
for(i=1;i<5;i=i+1){
for(j=1;j<=i;j=j+1){
System.out.print(“”+j);
}
System.out.println();
}}}
I.
how many times the first
loop of “i” will perform? [1]
II.
how many times the first
print statement work? [1]
III.
what will be the output
of the program? [3]
Question 4. [2X5=10]
1. What
is byte code?
2. int
a=15,b-21,c=0;
c=++a + b ++ *a++ -b
3. Differentiate
between binary search & linear search
4. What
is the purpose of default in switch case
5. What
are wrapper classes?
Section
B
Attempt
any 4 questions from this section
Each
program should be written using a variable list so that the logic of the
program is clearly depicted.
Question 5.
Design a class to overload a function polygon( ) as
follows:
i) void polygon(int n, char ch) with one integer argument
and one character type argument that draws a filled square of side n using the
character stored in ch.
ii) void polygon(int x, int y)
with two integer arguments that draws a filled rectangle of
length x and breadth y, using the symbol @
iii) void polygon()
with no argument that draws a filled triangle below.
Example :
i)
Input
value of n=2. Ch=’O’
Output: OO
OO
ii)
Input
value of x=2, y=5
Output:
@@@@@
@@@@@
iii) Output:
*
**
***
Question 6.
Write two separate
programs to generate the following patterns using iteration (loop)
statements:
a) b)
* 54321
*# 5432
*#* 543
*#*# 54
*#*#* 5 [ 15 ]
Question 7.
Write a program to accept the names of 10 cities in a
single dimension string array and their STD( Subscriber Trunk Dialing) codes in
another single dimension string array. Search for a name of a city input by the
user in the list, if found, display “Search Successful “ and print the name of
the city along with the STD code, or else display the message “ Search
unsuccessful, No such city in the list “.
[ 15 ]
Question 8.
a. using
switch case create class which take day number 1-7 & prints the
corresponding day in words [3- Wednesday, 5- friday] [7]
b. write
a class to input a number and print its odd factors[6 has odd factors 1,3] [8]
Question 9.
a. write
a class to print the following series [8]
S=a/1+a/2+a/3+a/4---------
a/n
b. write
a class Fibo10 to display the first 10 terms of Fibonacci series [7]
Question 10.
A company ABC consultants has employees
who are divided into 4 grades depending on their basic pay per month as follows
Basic
(Rs /month)
|
Grade
|
DA(in
percentage)
|
HRA(in
percentage)
|
20,001
or more
|
1
|
40
|
30
|
10,001
to 20,000
|
2
|
40
|
25
|
5000
to 10,000
|
3
|
30
|
20
|
5000
or less
|
4
|
30
|
15
|
If the net salary which is the total of
basic, DA, & HRA, is above 80,000 per month, then income tax @ of 30% of
annual salary exceeding 80,000 is deducted on monthly basis. Taking name of
employee and the basic ( monthly )pay as inputs, print name , grade, basic
salary, DA,HRA, monthly income tax ,Net salary for employee [15]