Anda di halaman 1dari 112

PDF brought to you by ResPaper.

com

ICSE Specimen 2014 Computer Applications

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/773/7179.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

PDF brought to you by ResPaper.com

ICSE Specimen 2013 Computer Applications

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/9560.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

PDF brought to you by ResPaper.com

ICSE Specimen 2011 Computer Applications

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/9516.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

PDF brought to you by ResPaper.com

ICSE 2014 : COMPUTER APPLICATIONS

Answer key / correct responses on:


Click link: http://www.respaper.com/utkarsh98/6297.pdf
Other papers by UTKARSH98 : http://www.respaper.com/utkarsh98/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

Page 2

Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

Page 3

Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

Page 4

Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

Page 5

Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

Page 6

Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

Page 7

Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

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 [ ].

SECTION A (40 Marks)


Attempt all questions.
Question 1.
(a)

What is meant by precedence of operators?

[2]

(b)

What is a literal?

[2]

(c)

State the Java concept that is implemented through:


(i)

a super class and a subclass

(ii)

the act of representing essential features without including background details.

(d)

Give a difference between a constructor and a method.

(e)

What are the types of casting shown by the following examples?


(i)

[2]
[2]

double x = 15.2;
int y = (int) x;

(ii)

int x = 12;
long y = x;

[2]

Question 2.
(a)

Name any two wrapper classes.

[2]

(b)

What is the difference between a break statement and a continue statement when
they occur in a loop?

[2]

T13 861

This Paper consists of 5 printed pages and 1 blank page.


www.javaforschool.com

Turn over

(c)

Write statements to show how finding the length of a character array and char[] differs
from finding the length of a String object str.

(d)

(e)

[2]

Name the Java keyword that:


(i)

indicates that a method has no return type.

(ii)

stores the address of the currently - calling object.

[2]

What is an exception?

[2]

Question 3.
(a)

Write a Java statement to create an object mp4 of class digital.

(b)

State the values stored in the variables str1 and str2

[2]

String s1 = "good"; String s2 = "world matters";


String str1 = s2.substring(5).replace('t', 'n');
String str2 = s1.concat(str1);

[2]

(c)

What does a class encapsulate?

[2]

(d)

Rewrite the following program segment using the if...else statement.


comm =(sale>15000) ? sale*5/100 : 0;

(e)

[2]

How many times will the following loop execute? What value will be returned?
int x = 2, y = 50;
do{
++x;
y - = x++;
} while(x<=10);
return y;

(f)

[2]

What is the data type that the following library functions return?
(i)

isWhitespace(char ch)

(ii)

Math.random()

[2]

ut + ft

(g)

Write a Java expression for

(h)

If int n[ ] = {1, 2, 3, 5, 7, 9, 13, 16} what are the values of x and y?

[2]

x=Math.pow(n[4],n[2]);
y=Math.sqrt(n[5]+[7]);

[2]

2
T13 861

www.javaforschool.com

(i)

What is the final value of ctr when the iteration process given below, executes?
int ctr=0;
for(int i=1;i<=5;i++)
for(int j=1;j<=5;j+=2)
++ctr;

(j)

[2]

Name the methods of Scanner class that:


(i)

is used to input an integer data from the standard input stream.

(ii)

is used to input a String data from the standard input stream.

[2]

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.

Question 4.
Define a class named FruitJuice with the following description:
Instance variables/data members:
int product_code

stores the product code number

String flavour

stores the flavor of the juice (E.g. orange, apple, etc)

String pack_type

stores the type of packaging (E.g. tetra-pack, PET bottle, etc)

int pack_size

stores package size (E.g. 200ml, 400ml, etc)

int product_price

stores the price of the product

Default constructor to initialize integer data members to 0 and


String data members to "".

Member Methods:
(i)

FriuitJuice()

T13 861

3
www.javaforschool.com

Turn over

(ii)

void input()

To input and store the product code, flavor, pack type, pack size
and product price.

(iii) void discount() -

To reduce the product price by 10.

(iv) void display()

To display the product code, flavor, pack type, pack size and

product price.

Question 5.
The International Standard Book Number (ISBN) is a unique numeric book identifier which is
printed on every book. The ISBN is based upon a 10-digit code. The ISBN is legal if:
1 x digit1 + 2 x digit2 + 3 x digit3 + 4 x digit4 + 5 x digit5 + 6 x digit6 + 7 x digit7 + 8 x digit8 +
9 x digit9 + 10 x digit10 is divisible by 11.
Example: For an ISBN 1401601499
Sum=1 x 1 + 2 x 4 + 3 x 0 + 4 x 1 + 5 x 6 + 6 x 0 + 7 x 1 + 8 x 4 + 9 x 9 + 10 x 9 = 253 which is
divisible by 11.
Write a program to:
(i)

Input the ISBN code as a 10-digit integer.

(ii)

If the ISBN is not a 10-digit integer, output the message, "Illegal ISBN" and terminate the
program.

(iii)

If the number is 10-digit, extract the digits of the number and compute the sum as
explained above.
If the sum is divisible by 11, output the message, "Legal ISBN". If the sum is not
divisible by 11, output the message, "Illegal ISBN".

[15]

Question 6.
Write a program that encodes a word into Piglatin. 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

[15]

4
T13 861

www.javaforschool.com

Question 7.
Write a program to input 10 integer elements in an array and sort them in descending
order using bubble sort technique.

[15]

Question 8.
Design a class to overload a function series() as follows:
(i)

double series(double n) with one double argument and returns the sum of the series,
sum =

(ii)

+ + + +

double series(double a, double n) with two double arguments and returns the sum
of the series,
sum =

+ to n terms

[15]

Question 9.
Using the switch statement, write a menu driven program:
(i)

To check and display whether a number input by the user is a composite number or
not (A number is said to be a composite, if it has one or more than one factor
excluding 1 and the number itself).
Example: 4, 6, 8, 9

(ii)

To find the smallest digit of an integer that is input:


Sample input : 6524
Sample output : Smallest digit is 2
For an incorrect choice, an appropriate error message should be displayed.

T13 861

5
www.javaforschool.com

[15]

Turn over

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 [ ].

SECTION A (40 Marks)


Attempt all questions
Question 1.
(a)

Give one example each of a primitive data type and a composite data type.

[2]

(b)

Give one point of difference between unary and binary operators.

[2]

(c)

Differentiate between call by value or pass by value and call by reference


or pass by reference.

[2]

(d)

Write a Java expression for 2

[2]

(e)

Name the type of error (syntax, runtime or logical error) in each case
given below:
(i)
Division by a variable that contains a value of zero.
(ii)
Multiplication operator used when the operation should be division.
(iii) Missing semicolon.

[2]

Question 2.
(a)

Create a class with one integer instance variable. Initialize the variable using:
(i)
default constructor.
(ii)
parameterized constructor.

T12 861

This Paper consists of 6 printed pages.


www.javaforschool.com

[2]

Turn over

(b)

Complete the code below to create an object of Scanner class:


Scanner sc = ______ Scanner ( _____________ );

[2]

(c)

What is an array? Write a statement to declare an integer array of 10 elements.

[2]

(d)

Name the search or sort algorithm that :


(i)

Makes several passes through the array, selecting the next smallest
item in the array each time and placing it where it belongs in the
array.
At each stage, compares the sought key value with the key value of
the middle element of the array.

[2]

Differentiate between public and private modifiers for members of a class.

[2]

(ii)

(e)

Question 3.
(a)

What are the values of x and y when the following statements are executed?
int a=63, b=36;
boolean x = (a>b) ? true : false ;
int y = (a<b) ? a : b;

(b)

[2]

State the values of n and ch.


char c = A;
int n = c+1;
char ch = (char)n;

(c)

[2]

What will be the result stored in x after evaluating the following expression?
int x = 4; x+= (x++)+(++x)+x;

(d)

[2]

Give output of the following program segment:


double x= 2.9 , y=2.5;
System.out.println(Math.min(Math.floor(x),y));
System.out.println(Math.max(Math.ceil(x),y));

(e)

[2]

State the output of the following program segment:


String s=Examination;
int n=s.length();
System.out.println(s.startsWith(s.substring(5,n)));
System.out.println(s.charAt(2) = = s.charAt(6));

[2]

2
T12 861

www.javaforschool.com

(f)

State the method that:


(i)
(ii)

(g)

Converts a string to a primitive float data type


Determines if the specified character is an upper case character.

State the data type and values of a and b after the following segment is
executed:
String s1= Computer, s2=Applications;
a = (s1.compareTo(s2));
b = (s1.equals(s2));

(h)

[2]

Rewrite the following program segment using while instead of for statement.
int f=1,i;
for(i=1; i< =5; i++)
{ f*=i; System.out.println(f);}

(j)

[2]

What will the following code output:


String s= malayalam;
System.out.println(s.indexOf(m));
System.out.println(s.lastIndexOf(m));

(i)

[2]

[2]

In the program given below, state the name and the value of the:
(i)
(ii)
(iii)
(iv)

method argument or argument variable


class variable
local variable
instance variable

class MyClass {
static int x = 7;
int y = 2;
public static void main(String args[]){
MyClass obj = new MyClass();
System.out.println(x);
obj.sampleMethod(5);
int a = 6;
System.out.println(a);
}

T12 861

3
www.javaforschool.com

Turn over

void sampleMethod(int n){


System.out.println(n);
System.out.println(y);
}
}

[2]

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 4.
Define a class called Library with the following description:
Instance variables/data members:
Int acc_num

stores the accession number of the book

String title

stores the title of the book

String author

stores the name of the author

Member methods:
(i) void input()

To input and store the accession number, title and author.

(ii) void compute()

To accept the number of days late, calculate and display the fine
charged at the rate of ` 2 per day.

(iii) void display()

To display the details in the following format:

Accession Number

Title

Author

Write a main method to create an object of the class and call the above member methods.

[15]

4
T12 861

www.javaforschool.com

Question 5.
Given below is a hypothetical table showing rates of income tax for male citizens
below the age of 65 years:
Taxable Income (TI) in `

Income Tax in `

Does not exceed ` 1,60,000

Nil

Is greater than ` 1,60,000 & less than or equal to

(TI 1,60,000) x 10%

` 5,00,000
Is greater than ` 5,00,000 & less than or equal to
` 8,00,000
Is greater than ` 8,00,000

[(TI 5,00,000) x 20%] + 34,000


[(TI 8,00,000) x 30%] + 94,000

Write a program to input the age, gender (male or female) and Taxable Income of a
person.
If the age is more than 65 years or the gender is female, display wrong category.
If the age is less than or equal to 65 years and the gender is male, compute and display
the Income Tax payable as per the table given above.

[15]

Question 6.
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

[15]

Question 7.
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 @

T12 861

5
www.javaforschool.com

Turn over

(iii) void polygon()

with no argument that draws a filled triangle


shown below.

Example:
(i)

Input value of n = 2, ch=O


Output:
OO
OO

(ii)

Input value of x = 2, y = 5
Output:
@@@@@
@@@@@

(iii)

Output:

*
**
***

[15]

Question 8.
Using the switch statement, write a menu driven program to:
(i)

Generate and display the first 10 terms of the Fibonacci series


0,1,1,2,3,5,.
The first two Fibonacci numbers are 0 and 1, and each subsequent number is
the sum of the previous two.

(ii)

Find the sum of the digits of an integer that is input.


Sample Input:
Sample Output:

15390
Sum of the digits = 18

For an incorrect choice, appropriate error message should be displayed.

[15]

Question 9.
Write a program to accept the names of 10 cities in a single dimension string array and
their STD (Subscribers Trunk Dialing) codes in another single dimension integer 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 its STD code, or else display
the message Search Unsuccessful, No such city in the list.

[15]

6
T12 861

www.javaforschool.com

PDF brought to you by ResPaper.com

ICSE 2011 : COMPUTER APPLICATIONS

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/1039.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/1039.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/1039.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/1039.pdf

PDF brought to you by ResPaper.com

ICSE 2010 : COMPUTER APPLICATIONS

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/3231.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

PDF brought to you by ResPaper.com

ICSE 2009 : COMPUTER APPLICATIONS

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/3890.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

PDF brought to you by ResPaper.com

ICSE 2007 : COMPUTER APPLICATIONS

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/9737.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

PDF brought to you by ResPaper.com

ICSE 2006 : COMPUTER APPLICATIONS

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/1446.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

PDF brought to you by ResPaper.com

ICSE 2005 : COMPUTER APPLICATIONS

Answer key / correct responses on:


Click link: http://www.respaper.com/icse/161/4290.pdf
Other papers by ICSE : http://www.respaper.com/icse/

Upload and share your papers and class notes on ResPaper.com. It is FREE!
ResPaper.com has a large collection of board papers, competitive exams
and entrance tests.
http://www.respaper.com/

Page 1

Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

Page 2

Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

Page 3

Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

Page 4

Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

ICSE Sample Papers for March 2015 Exams

Prelium 2013
ST. GREGORIOS IIIGH SCHOOL
std. x
COMPUTER APPLICATIONS
to this paper
on me paper
separately. You
allowed to write during the first 10 minutes. Thistime to be spent in reading the question
paper. The time given at the head of this paper is time allowed for the writin-g the answers
This paper is divided into two sections. You are to answer allquestions from section A, and
any four questions from section B. The intended
ryarkslor questions or parts of questions are
given in brackets [].

'

Atte,o';fo"Jj$:ffi#l[il,""tion.

Question 1.
Answerthe following.
What is meant by precedence of operators ?
b) What is a null statement in java ?
c) Name any two wrapper class.
d) How are data and functions organized in OOp ?
e) What is meant by base type of an anay ?

t5x2I

i)

Question 2.
Difference between the following.
a) Constructor and rnethod.
b) Class and object.
c) Operator and operand.
d) Local and globalvariable.
.e) SlecUon controland iteration control.
QuesUon 3.
Give the ouiput of the tuilowing.
a) How many times will the foltowing loop execute? What.;alue wiil be the value
Of x?
int x=2, y=S0;

t5x2l

[5x2]

do
{

++xlY-=x++;

)while(x<=10);

i.Dtiii ;,

b) lf

int

D
ii)

= {1,2,3,5,7,9,13,16}, what are the values of


X=Math.pow(n[4], n[2]);
y= Math.sqrt(n[Sl+nJ4;.

c)

char m= 'A; int p = 25; wtrat will be tre ouput of the statement ?
System.but. prinfl n((char)m+p1 ;
System.out.println('answer' + m+p);-

d)

String s[ = ("nasi/, 'shabina', "shaikh");


for(i=O; i<=2; i++)

n
Secret to 90% in Boards

n[

Sy$tern.out.println(slil.eharAt(i));
)
,

I Exam18.com
Buy FullPaee
Set from

.rl

ht
ICSE Sample Papers for March 'q
2015 Exams

e)

i) System.out.pritnln(Math.round(-5.49));

ii)

System.out.pritnln(Math. rintG5.49));
iii) System.out.pritnln(Math.ceilG0.03)) ;
iv) System.out.pritnln(Math.fl oor(-0.03))
v) Syetem.out.pritnln(Math.ceil(O.03));

[5x2]

Question 4.

a)

if the following snippets are conect, show,the output, if not specify the

enor and explain.


int a=5, b=6, d=7;

i)

ii)

if (a>b)

if(a>b);

t
d=9;

else

System.out. println(d);

d=9;
)
System.out. println(d);

iii)
'

iv)

int i=5;
while(i==S)
if(i==5)
continue;

int x=10;

fo(int i-1; i<-x; i++;


if(x>10)
break;
x=x-2i
System.out. println(x);

i++;

System.out.

v)

Pri

ntln(i)

if a=10, then find c?. Show steps of working.


*
6= **!l + a++ - -a-a- + a + a I ai

SECTION 8[60 Markst

pr"oq,,*"il:[;H[U,:Xfi'[it""l1H#i;ff

'llLqurrcdw*h

every JAVA progriam and descriptlon of varlables used ln the program.

Qugtion 5.

,/

Design the class to catculate and diplay sum of odd digits and product of even

dig'tts of the number.

name

Yo'd

: Calculate
Class
lnstance variable ldala member:
: integer, to store number.
Member function / methods :: to accept the number.
void inputQ
: to calculate antrc{rrn sum of odd digits
ialcalc(int)
of even digits.

Example

product

.13/,526
surn will be 1+3+5 = 9

product will be 4'2*6 = 48

PaseZ

Secret to 90% in Boards

and

"r'l
Buy Full Set from Exam18.com

ICSE Sample Papers for March 2015 Exams

Download the Full Question Paper from Exam18.com


This Question Paper is a part of the Prelim Papers Package of ICSE Class 10 for 2015
Examinations and available exclusively on Exam18.com
You can download the Question papers (All Subjects) of 10 Schools, 15 Schools or 25
Schools for Rs. 400, Rs. 600, Rs. 800 respectively.
If you buy 10 Schools Prelim Question Papers, you get:
No. of Question Papers = 12 Subjects x 10 Schools = 120 Question Papers
Cost of E-Book Rs. 400
Cost of Printed Book (Free Home Delivery Across India!) Rs. 800
If you buy 15 Schools Prelim Question Papers, you get:
No. of Question Papers = 12 Subjects x 15 Schools = 180 Question Papers
Cost of E-Book Rs. 800
Cost of Printed Book (Free Home Delivery Across India!) Rs. 1200
If you buy 25 Schools Prelim Question Papers, you get:
No. of Question Papers = 12 Subjects x 25 Schools = 300 Question Papers
Cost of E-Book Rs. 800
Cost of Printed Book (Free Home Delivery Across India!) Rs. 1500

How to Pay?
You can Pay for these Books using your Credit Card/Debit Card/NetBanking or Cash
on Delivery.
Delivery Time
Delivered in 1-7 days after Placing your Order on Exam18.com
Want to get this Complete Book? Click here to Order E-Book (Only Online Payment
Option Available since it is E-Book and delivered instantly to your Email after Payment)
Click here to Order Printed Book
Visit Exam18.com Or Call Helpline 07666303006 or email care@exam18.com

Secret to 90% in Boards

Buy Full Set from Exam18.com

JAVA FOR SCHOOL

SAMPLE PAPER 8

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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 [ ].

SECTION A (40 Marks)


Attempt all questions

Question 1.
(a)
(b)

Mention any two rules for naming identifiers.


How do we invoke a constructor? Explain with an example.

[2]
[2]

(c)

Write a Java statement to create an object named 'jfs' of a class 'Computer' that invokes
a parameterized constructor that accepts two integer type values.

[2]

(d)

How is the concept of Data Abstraction implemented in Java?

[2]

(e)

Write the expression for the absolute value of 2

[2]

+3

Question 2.
(a)
(b)

(c)

Assign the constant value of pi (i.e. 3.142) to a variable mentioning its appropriate
data type.

[2]

Name the Java keyword that:


(i)

is used to finish the execution of a program

(ii)

is used to implement the concept of inheritance.

[2]

If int A[ ] = {9,8,0,4,5,6,6,8,1,5}; What are the values of 'm' and 'n'?.


m = Math.max(Math.pow(A[1],A[2]) , Math.sqrt(A[3]));

(d)
(e)

n = Math.pow(Math.min(A[1],A[7]), A[3]);

[2]

What is the difference between a String object and StringBuffer object?


Write a Java statement to check whether two string object 's1' and 's2' are equal or
not, using compareTo() function.

[2]
[2]

This Paper consists of 4 printed pages.


TSP008

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 8

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 3.
(a)

Rewrite the following code fragment without break and continue.


while(ch != '*')
{
if(ch == '?')
break;
if(ch != '\n')
continue;
line++;
}

(b)

[3]

What will be the result of the following code:


String s1 = "Feeling Sleepy";
String s2 = "Watching Television";
(i)
(ii)

System.out.println(s1.compareTo(s2));
System.out.println(s1.concat(" Still ").concat(s2));

[2]

(c)

State the difference between Selection Sort and Bubble Sort.

[2]

(d)

Find the errors in the following code snippet and correct them:
boolean true = a;
If(false)
System.Out.Println("Nothing in here")
else
System.out.println(Correct this mistake);

[3]

Question 4.
(a)

(b)

(c)

State the purpose and return datatype of the following wrapper class functions:
(i)
toString(long n)
(ii)
parseLong(String s)

[2]

Identify the following as valid or invalid identifier names. State reasons.


(i)
_123
(ii)
break
(iii)
T$
(iv)
var.1

[2]

Analyze the following program segment and answer the following questions:
class JavaForSchool
{
public void methodInfo()
{
char a = 'A', b = 'a';
int c = a++ + b;
}
}
(i)
(ii)
(iii)
(iv)

(d)

What value is stored in 'c' after the method gets executed?


What is the value stored in 'a' after the execution of the method?
Define the main() method which calls the above method.
Modify methodInfo() so that the resultant 'c' is displayed on the screen.

What is the scope of the keyword 'protected' in accessing a method.

[4]
[2]

2
TSP008

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 8

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 5.

[15]

An Emirp number is a number which is prime backwards and forwards.


Example: 13 is an Emirp number since 13 and 31 are both prime numbers.
Write a program to accept a number and check whether it is an Emirp number or not.
Question 6.

[15]

Define a class WordOp having the following description:


Data members/instance variables:
str
max
min

:
:
:

to store a word
to store the highest alphabetical character present in the word
to store the lowest alphabetical character present in the word

Member functions:
WordOp()
void input()
void calcMaxMin()
void display()

:
:
:
:

default constructor
to accept the word in UPPERCASE
to find the highest and the lowest character present in the word.
to display the word along with the highest and the lowest character
Example:
If word is "TWEAK"
Highest Character = W
Lowest Character = A

Question 7.

[15]

Design a class to overload a function volume() as follows:


(i)

double volume(double r) with one double argument, returns the volume of


a sphere using the formula:

volume =
(ii)

double volume(double r, double h) with two double arguments, returns the


volume of a cone using the formula:

volume =
(i)

double volume(double l, double b, double h) with three double arguments,


returns the volume of a cuboid using the formula:
volume = l x b x h

3
TSP008

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 8

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 8.

[15]

The production (P) of crude oil of a country in millions of barrels may be estimated by the
following set of equations, where t represents the time duration in years:
P = 5 + 3t
P = 14 + (t - 5/2)2

for 0 t 3
for t > 3

Write a program in Java to input a year from the user and find and print the production for
every year from the year 2000 to the inputted year.
Print the output in the following format:
Year
----------------------------

Production
----------------------------

Question 9.

[15]

A cloth showroom has announced the following seasonal discounts on purchase of items:
Purchase Amount (`)
0 - 1000

Discount
Mill Cloth

Handloom Items

-------

5%

1001 - 2000

5%

7.5 %

2001 - 3000

7.5 %

10 %

Above 3000

10 %

15 %

Write a Java program to input the purchase amount and Item Code viz : M or m for Mill Cloth
and H or h for Handloom Items.
Calculate the discount amount. Find the net balance to be paid excluding the discount.
Print the Purchase Amount, Item Type, Discount and the net amount to be paid.

Question 10.

[15]

Write a program to input an integer array A[] of n size. Sort the array in ascending order.
Then input another number from the user and replace all the numbers less than that inputted
number by their reverse.
Example

If A[] = {38, 25, 16, 91, 5, 12} then,


array after sorting is {5, 12, 16, 25, 38}
If the number entered = 20 then,
after replacing all the numbers less than 20 with their reverse,
final Output is {5, 21, 61, 25, 38}

4
TSP008

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 7

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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 [ ].

SECTION A (40 Marks)


Attempt all questions

Question 1.
(a)
(b)

What are keywords? Give any two examples.


What is an array? Write the general syntax for creating an array.

[2]
[2]

(c)

What is the difference between subscript and subscripted variable?

[2]

(d)

Name any two characteristic features of Java.

[2]

(e)

Mention two different styles of expressing a comment in a program.

[2]

Question 2.
(a)

Name the Java keyword that:


(i)

is used for dynamic memory allocation to reference data types

(ii)

is used to declare class variables.

[2]

(b)

State the difference between a Constructor and a Method.

[2]

(c)

Explain "Call by reference".

[2]

(d)
(e)

What is the difference between a formal and actual parameters?


Explain the use of the below given functions:

[2]

(i)

endsWith()

(ii)

random()

[2]

This Paper consists of 4 printed pages.


TSP007

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 7

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 3.
(a)

Detect errors if any in the below given statement and rewrite it correctly:
If(2x + 5 = 10 && x>0)

[2]

(b)

String
String
(i)
(ii)
(iii)
(iv)

[4]

(c)

Write a Java statement to:

(e)

s1="I LOVE";
s2 = "JAVA FOR SCHOOL";
System.out.println(s1.substring(0).concat(s2.substring(0,4))
System.out.println(s2.substring(2,10));
System.out.println(s2.replace('O', 'o'));
System.out.println(s2.charAt(s1.indexOf('V') + s2.indexOf('H')));

(i)

Extract the second last character of a word stored in the variable wd.

(ii)

Check if the second character of a string 'str' is in uppercase

[2]

What is the use of the keyword import?

[2]

Question 4.
(a)

State the output of the following program segment according to the inputs as mentioned:
with each part:
if(x++ == 11)
System.out.print("RESULT
else if(++x == 10)
System.out.print("RESULT
else if(- -x == 10)
System.out.print("RESULT
else
System.out.print("RESULT
(i)

(c)

x=9

(ii)

IS 11");
IS 10");
IS 10");
IS NEITHER 10 NOR 11");

x = 10

(iii)

x = 11

(iv)

x = 12

What will the following functions return when executed:


(i)

Math.pow (2, Math.sqrt(36))

(ii)

Math.rint(32.17)

[2]

(d)

Write a Java expression for:

(e)

Write the prototype of a function 'divide' that takes two integer values and returns the
quotient in double type.
Name the package which contains the Scanner class?

(f)

[4]

[2]

[1]
[1]

2
TSP007

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 7

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 5.

[15]

Define a class Employee having the following description:


Data members/instance variables:
pan
name
taxincome
tax

:
:
:
:

to
to
to
to

store
store
store
store

personal account number


the name
the annual taxable income
the tax that is calculated

Member functions:
Employee()
void input()
void calc()

:
:
:

default constructor
to accept the pan number, name and taxable income
calculate the tax for an employee according to the given conditions:

Total Annual Taxable Income


Upto Rs. 100000
From Rs. 100001 to Rs. 150000
From Rs. 150001 to Rs. 250000
Above Rs. 250000
void display()

Pan Number
___________

Name
_____

Tax Rate
No tax
10% of the income exceeding Rs. 100000
Rs. 5000 + 20% of the income exceeding Rs. 150000
Rs. 25000 + 30% of the income exceeding Rs. 250000

output the details of the employee as per given format:


Taxable Income
______________

Question 6.

Tax
____

[15]

Write a Java program to accept a string. Extract the last character from it and form a new string after
adding the extracted character at the first and last places in the given string. Print the entered and
new string.
Sample Input
:
Java
Sample Ouptut
:
aJavaa
(where 'a' is the last character in the string Java)

3
TSP007

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 7

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 7.

[15]

Write a menu driven program in Java:


(a)
to input a number and check whether it is a NEON number or not
(b)
to print the REPUNIT series: 1, 11, 111, 1111, . upto 'n' terms
Note:
NEON:

A number is said to be NEON, if sum of all the digits of the square of the number
is equal to the number itself.
For example 9 is a NEON number
(Workings: Square of 9 = 81. Sum of digits of square: 8 + 1 = 9)

Question 8.

[15]

Write a Java program to print the reverse of all the numbers in the range 'p' to 'q', where p<q (both
inclusive). Print the output in the following format:
Number
----------------------------

Reverse
----------------------------

Question 9.

[15]

Design a class to overload a function pattern() as follows:


(i)

void pattern(char ch, int n) with one character and one integer argument and prints
'n' lines containing the character stored in 'ch' in the following pattern,
If ch = @ and n = 3, then output:
@
@@
@@@

(ii)

double pattern(double x, double n) with two double arguments and returns the sum
of the series,

S=

x
+
n

x
x
x
x
+
+ + +
1 n2
2
1

Question 10.

[15]

Write a program to input an integer array A[] of n size. Store all even integers of array A[]
from left to right and all odd integers from right to left in another array B[]. Print both the arrays.
Example
:
If A[] = {3, 6, 9, 5, 12, 14, 8, 18, 7, 21, 10, 4} then,
B[] = {6, 12, 14, 8, 18, 10, 4, 21, 7, 5, 9, 3}

4
TSP007

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 6

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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 [ ].

SECTION A (40 Marks)


Attempt all questions
Question 1.
(a)
(b)

Define this keyword. What is its significance?


State the Java concept that is implemented through:

[2]

(i)

dividing a long set of instructions into smaller groups/modules

(ii)

the wrapping up of data and its associated function into a class.

[2]

(c)

Differentiate between parameterized and non-parameterized constructor.

[2]

(d)

What are wrapper classes? Give an example.

[2]

(e)

Write statements to show how finding the length of a character array ch[] differs
from finding the length of a String object str.

[2]

Question 2.
(a)

Name the Java keyword that:


(i)

indicates that a method has no return type.

(ii)

converts a variable into a constant.

[2]

(b)

What is polymorphism? How does function overloading implement polymorphism?

[2]

(c)

Explain: "Objects encapsulate characteristics and behaviour"

[2]

(d)
(e)

What is the difference between a pure and mixed expression.


Explain the use of the below given functions:

[2]

(i)

trim()

(ii)

isWhitespace()

[2]

This Paper consists of 4 printed pages.


TSP006

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 6

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 3.
(a)

Write correctly the following statement:


String S = ["A", "E", "I", "O", "U"];

[2]

(b)

What is the need of type-casting?

[2]

(c)

Write a Java statement to:

(d)

(e)

(i)

create an object mp3 of class Music

(ii)

import all the classes of the package named simple

[2]

What will the following functions return when executed:


(i)

Math.max (-7, Math.min(-2, -9))

(ii)

Math.ceil (32.17)

[2]

State the output of System.out.println("Java".length() + "For School".length()).

[2]

Question 4.
(a)

State the output of the following program segment:


class Today {
static int a;
char b;
void input()
{
a = 20;
b = 'Z';
}
void convert()
{
char c = (char)(a+b);
System.out.println(c);
}
public static void main() {
Today t = new Today();
t.input();
t.convert();
}
}

(b)

Based on the above given piece of code, answer the questions which follow:
(i)
(ii)
(iii)

(c)

[2]

Name the instance, class and local variables.


What is the name of the constructor of the above class?
Explain the line: Today t = new Today();

[3]

Given a character array: char arr[] = {'J', 'A', 'V', 'A'}; and an integer: int b = 2;
What will be the output of the below statements if they are executed one after the other:
(i)

System.out.println(arr[b++]);

x=

(ii)

System.out.println(arr[b]++);

(d)

Write a Java expression for:

(e)

Write the prototype of a function which takes in 2 integer and 1 String arguments, and
returns a value which is either 'true' or 'false'

[2]
[2]
[1]

2
TSP006

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 6

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 5.

[15]

Write a menu driven program in Java to input a number and check whether it is a:
(a)
DISARIUM number or not
(b)
DUCK number or not
Note:
DISARIUM: A number will be called DISARIUM if sum of its digits powered with their respective
position is equal to the original number.
For example 135 is a DISARIUM
(Workings 11+32+52 = 135, some other DISARIUM are 89, 175, 518 etc)
DUCK:

A Duck number is a number which has zeroes present in it, but there should be no
zero present in the beginning of the number.
For example 3210, 7056, 8430709 are all Duck numbers whereas 08237 is not.

Question 6.

[15]

An airlines announces discount on tickets depending upon destination chosen by the passenger from
the following:
Destination
America
Singapore
Japan
Thailand

Rate of ticket (per person)


Rs. 50000.0
Rs. 20000.0
Rs. 40000.0
Rs. 30000.0

The discount will be given as per the given criteria:


Ticket Amount
Above Rs. 200000
Rs. 150001 to Rs. 200000
Rs. 100001 to Rs. 150000
Less than Rs. 100000

Discount on Total amount


25%
20%
15%
10%

Write a Java program to input name of the passenger/group head (in case of more than 1 passengers),
number of passengers and destination code viz: A or a for America, S or s for Singapore, J or j for
Japan, and T or t for Thailand.
Calculate the total ticket amount and discount amount. Find the net balance to be paid excluding the
discount. Print name, number of passengers, destination code, discount and total ticket amount to be
paid.

3
TSP006

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 6

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 7.
[15]
Write a Java program to input a sentence from the user in lowercase and capitalize the first and the
last characters of every word in it.
Sample Input
:
i love java for school.
Sample Ouptut
:
I LovE JavA FoR SchooL
Some of the data members and member functions are given below:
Class name : Capitalize
Data members/instance variables:
sent
cap
size

:
:
:

stores the sentence


to store the new sentence
stores the length of the sentence

Member functions:
Capitalize()
:
void readsentence() :
void capfirstlast()
:
void display()

default constructor
to accept the sentence
extract each word and capitalize the first and the last alphabet of the word
and form a new sentence 'rev' using the changed words
display the original sentence along with the new changed sentence.

Specify the class Capitalize giving details of the constructor Capitalize (), void readsentence(), void
capfirstlast() and void display(). Define the main() function to create an object and call the function
accordingly to enable the task.
Question 8.

[15]

Write a Java program to input a sentence. Count the number of times a particular word occurs in it.
Display the frequency of the search word.
Sample Input

Sample Ouptut

Enter a sentence
Enter a word to be searched
Frequency of searched word

:
:
:

To be or not to be
be
2

Question 9.

[15]

Design a class to overload a function series() as follows:


(i)

double series(double n) with one double argument and returns the sum of the series,

S=1+
(ii)

1 1
1
+ + +
2! 3!
n!

double series(double x, double n) with two double arguments and returns the sum
of the series,

S=

x x
x
x
+ + + +
1 4
9
n

Question 10.

[15]

Write a program to input two integer arrays A[] and B[] of m and n sizes respectively. Create a
third array C[] by merging the array A[] followed by the array B[].
Sample Input
Sample Output

:
:

A[] = {6, 15, 7, 4, 9} and B[] = {3, 24, 6}


C[] = {6, 15, 7, 4, 9, 3, 24, 6}

4
TSP006

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 5

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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 [ ].

SECTION A (40 Marks)


Attempt all questions
Question 1.
(a)
(b)
(c)
(d)
(e)

Give the pictorial representation of the Java Compilation process.


"Java is a Case Sensitive language" True or False?
Can there be an if without an else? Give an example.
What is a loop?
Find the output of the following program segments, when: (a) val = 500 (b) val = 1600
int val, sum, n = 550;
sum = n + val > 1750? 400:200;
System.out.println(sum);

[2]
[1]
[2]
[2]
[3]

Question 2.
(a)
(b)
(c)
(d)

If a = 5, b = 9, calculate the value of a + = a++ - ++b + a


State one similarity and one difference between 'while' and 'for' loop.
What is the use and syntax of a ternary operator?
Rewrite the following program correctly:

[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)
}
}

This Paper consists of 4 printed pages.


TSP005

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 5

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 3.
(a)

What is the output of the following:


(i)
char c = 'A';
short m = 25;
double n = c + m;
System.out.println (n);
(ii)
int x = 10, y = 5, z;
if(x > y || x ==y)
z = ++x + --y;
System.out.println(z + " " + x + " " + y);

[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)

Explain the use of toUpperCase ( ) function. Give an example.


What are the types of casting shown by the following examples?
(i)
double x = 15.2;
int y = (int) x;
(ii)
int x = 12;
long y = x;

[2]
[2]

(c)

What is the difference between a break statement and a continue statement when
they occur in a loop?

ut + ft

(d)

Write a Java expression for

(e)

The following program prints out the pattern given below:


2
24
246
2468
Some parts of the program are marked by ?1? , ?2? ,?3? , ?4? that must be replaced by
statements so that the program works correctly.

[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

JAVA FOR SCHOOL

SAMPLE PAPER 5

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 5.
A class Compound is created to calculate the compound interest using:

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)

Compound ( ) constructor to assign default values to all the data members.


void input( ) to input the principal, rate and time from the user.
double findInterest( ) to find and return compound interest using the given formula.
void printData( ) to print the principal, rate and time.

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

Discount on total amount


10%
15%
20%
25%

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

JAVA FOR SCHOOL

SAMPLE PAPER 5

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 8.
Write a menu driven program to perform the following operations using switch-case.
(a)

Compute and display the sum of the following series:

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:

Type 1 for a Triangle or


Type 2 for a Pyramid: 2
A
B B
C C C
D D D D
E E E E E

[15]

4
TSP005

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 4
ICSE (Class X)

Making Java Fun To Learn

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 [ ].

SECTION A (40 Marks)


Attempt all questions
Question 1.
(a)
(b)
(c)

(d)
(e)

What is Data Hiding?


What is meant by private visibility of a method?
Find and correct the errors in the following program segment.
int n[ ] = (2,4,6,8,10);
for(int i=0;i<=5;;i++)
System.out.println("n["+i+"] + n[i]);
Explain the statement "Java is a Compiled and Interpreted Language"
What is UNICODE?

[2]
[2]
[2]

[2]
[2]

Question 2.
(a)
(b)
(c)
(d)
(e)

Explain "Write Once Run Anywhere (WORA)"


Explain the Identifier Naming Rules.
What will be the result of the following two expressions if i=10 initially:
(i)
++i<=0
(ii)
i++<=10
State the difference between Class Variable, Instance Variable and Local Variable.
What do you mean by an empty loop? Give example.

[2]
[2]
[2]
[2]
[2]

Question 3.
(a)
(b)
(c)
(d)
(e)

Explain the following terms :


(1)
"static" keyword
(2)
Escape Sequence
Differentiate between Java Applications and Java Applets.
When two mathematical operations have the same precedence, how is the operation
performed?
Can arrays be initialized before declaring them? Give example.
Give two rules to be followed while overloading a function.

[2]
[2]
[2]
[2]
[2]

This Paper consists of 3 printed pages and 1 blank page.


TSP004

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 4
ICSE (Class X)

Making Java Fun To Learn

Question 4.
(a)

(b)
(c)
(d)

State the output of the following program segment:


int i=1;
int s[ ]={2,4,6,7,8,9,10};
while(i<s.length)
{
System.out.println(s[i]+1);
if(i<s.length-3)
s[i+1]++;
i++;
}
What is an array? How is it different from a String?
What is the role of 'function signature' in a function declaration?
Write a valid Java statement for each of the following:
(1)
Store a number 800.00 as a String.
(2)
Convert the String object 'add' into lowercase form.
(3)
Check the equality of two Strings and store the result into a variable 'res'.

[2]

[3]
[2]
[3]

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 5.
Write a program in Java to print all the PALINDROME 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: A Palindrome number is a number whose reverse is equal to the original number.]
[15]
Question 6.
Write a menu driven program to input a number (<=50) from the Decimal Number system and
perform the following operations using switch-case:
(a)
(b)

Convert it into its equivalent Binary number using the function void binary(int)
Convert it into its equivalent Roman number using the function void roman(int)

[15]

Question 7.
Write a Java program to input a sentence from the user and display the words which contain the
alphabet 'A' in them in either Lowercase or Uppercase.
Sample Input
:
All is well that ends well.
Sample Ouptut
:
All
that

[15]

2
TSP004

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 4
ICSE (Class X)

Making Java Fun To Learn


Question 8.

A Credit card company allows a limit to spend `15000 to its clients. It also offers a cash back
facility according the table shown below. Input the amount spent by the use and display the
cash back amount he is entitled to. Use minimum number of conditions to solve the problem.
Amount (in `)
First 1000
Next 2000
Next 4000
Next 8000

Cash Back (in `)


100
200 + 2% of amount exceeding 1000
400 + 4% of amount exceeding 3000
800 + 8% of amount exceeding 8000

Write a program to declare the class 'Credit' that takes in the name of the client and the
amount spend by him. Calculate the cash back amount and print it along with all the other
details.
[Note: Perform this for 20 clients. Hint: Use Arrays]
[15]
Question 9.
(a)

A "XYZ Bank Ltd." accepts for one year or more and the rule that bank adopts for paying
the interest is as follows:
(i)

If a deposit is less than ` 2000 and it is for 2 years or more, the interest rate is
5% compounded annually.

(ii)

If a deposit is ` 2000 or more but less than ` 6000 and for 2 years or more, the
interest rate is 7% compounded annually.

If a deposit is more than ` 6000 and it is for 1 year or more, the interest rate is
8% compounded annually.
(iv)
On all deposits for 5 years or more, interest is 9.75% compounded annually.
(v)
On all other deposits not under the above conditions, the interest is 3%
compounded annually.
Write a program to input amount to deposit and number of years. Calculate the interest
and total balance amount after the given number of years. Print amount deposited,
number of years, interest gained and total amount paid after the given years.

[8]

The production (P) of crude oil of a country in millions of barrels may be estimated
by the following set of instructions:
P = 5 + 3t,
for 0 < t < = 3
P = 14 + (t 5/2), for t >3
Write a program in Java to find the quantity of production for every year t = 1 to 10
and print it.

[7]

(iii)

(b)

Question 10.
(a)
(b)

Write a program to find the sum of the following series:


1 - 21 + 32 - 43 + 54 - ... upto n terms
Write a program to compute the middle digit of a number entered. If the number does
not have a middle digit, it has to give the average of the two middle digits.

[7]
[8]

All the Best.


Dont Worry, You wont Fail
3
TSP004

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 3

Making Java Fun To Learn


ICSE (Class X)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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 [ ].

SECTION A (40 Marks)


Attempt all questions
Question 1.
(a)
(b)

(c)
(d)
(e)

What is a wrapper class? Give any two examples.


State any one difference between:
(i)
pure and impure function.
(ii)
pure and mixed expression.
Explain the term "type-casting" with an example.
Explain the statement "An object is an instance of a class"
What will be the output of the following code:
int m=2,n=15;
for(int i=1;i<5;i++);
{
m++;
--n;
}
System.out.println("m="+m);
System.out.println("n="+n);

[2]
[2]

[2]
[2]
[2]

Question 2.
(a)

State the output of the following program segment:

[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')));

This Paper consists of 5 printed pages and 1 blank page.


TSP003

www.javaforschool.com

Turn over

JAVA FOR SCHOOL

SAMPLE PAPER 3

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(b)
Differentiate between nextDouble() and hasNextDouble() functions with an example.
[2]
(c)

Explain Function Overloading with an example.

[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)

What is the difference between '= =' and 'equalsIgnoreCase( )'

[2]

(b)

What are packages? Write the Java statement for importing a package named 'happy'.

[2]

(c)

Write a Java expression for

(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)

The following program prints out the pattern given below:


z
zy
zyx
zyxw
Some parts of the program are marked by ?1? , ?2? ,?3? , ?4? that must be replaced by
statements so that the program works correctly.
void pattern()
{
char st;
for(int i=1; i<?1?;i++)
{
st=?2?;
for(int j=1;j<=?3?;j++)
{
System.out.print(st+" ");
?4?;
}
System.out.println();
}
}

[4]

2
TSP003

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 3

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(b)

Rewrite the following program segment using ternary operator :


if(avg>= 40 && avg<=100)
grade='P';
else
grade='F';

[2]

(c)

State the difference between the keywords 'throw' and 'throws'.

[2]

(d)

Write the function "check" which takes two integer arguments (x,y) and returns 'true'
if x>y otherwise returns 'false'

[2]

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 5.
Define a class Student takes in the name, Roll No. and the total marks of five subjects of 20
students Each student is assigned a stream based on the following criteria:Average marks

Stream

90
80
70
60

Science with Computers


Science without Computers
Commerce with Maths
Commerce without Maths.

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

JAVA FOR SCHOOL

SAMPLE PAPER 3

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 7.
Write a menu driven program to perform the following operations using switch-case:
(a)

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(int a, int b, int c, int d)


void showDistance()
void sumDistance()

:
:
:

Distance
f1,f2 (integers to store the feet value of 2 distances)
inc1,inc2 (integers to store the inch value of 2 distances)

constructor to assign a to f1, b to inc1, c to f2 and d to inc2


to display both the distances with suitable message
to find the sum of distances and print it.

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]

+ +

(b) void printSeries(String s) to print the String in the following format:


Example: If s = "TIGER"
Output:
R
RE
REG
REGI
REGIT

[15]

4
TSP003

www.javaforschool.com

JAVA FOR SCHOOL

SAMPLE PAPER 3

Making Java Fun To Learn


ICSE (Class X)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Question 10.
A class HiArm has been defined to find whether a given number is an Armstrong number or not.
Some members of the class are given below:
Class name

HiArm

Data members/instance variables


n

:
:

integer data to store the number.

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

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 [ ].

SECTION A (40 Marks)


Attempt all questions
Question 1.
(a)
(b)
(c)
(d)

(e)

What is JVM?
What are Unary and Binary Operators? Give examples of each.
What is an Infinite loop? Write an example of it using for-loop.
What will be the result of the following if n = 3.5
(i)
Math.ceil(n)
(ii)
Math.round(n)
(iii)
Math.floor(n)
If x = 6, y = 4 and z = 2.3, evaluate u and v after executing successively (i) and (ii):
(i)
u = x + y / z;
(ii)
v = (x++)*z + x;

[2]
[2]
[2]
[2]

[2]

Question 2.
(a)

Rewrite the following program segment using switch-case :


char code;
if(code == B || code == b)
System.out.println(Businessman);
if(code == F || code == f)
System.out.println(Fighter);
if(code == E || code == e)
System.out.println(Employee);
if(code == I || code == i)
System.out.println(Intelligent);

[3]

(b)
(c)

What is exception handling? Name any one way in which Java handles exceptions.
Which part of a function declaration differentiates between overloaded functions?

[2]
[2]

This Paper consists of 5 printed pages.


TSP 002

www.javaforschool.com

Turn over

(d)
(e)

Write a Java expression for ( + ) ( + )


Name the Character Set followed by Java?

[2]
[1]

Question 3.
(a)
(b)

State the difference between break and continue keywords.


[2]
Write Java statements to:
[5]
(i)
replace all occurrences of character r with h in the String Programmer
(ii)
initialize a character array ch with the characters of the word Transition
(iii)
convert a character stored in variable test into Upper Case
(iv)
write the prototype of a method that returns true/false and takes 2 strings as parameters
(v)
input an integer using Scanner class object sc

(c)

Write a for loop statement that initializes a loop variable k as 100, decrements it by 1 in
every pass and executes the loop body infinite no. of times.?
Give the output in the following function and also write what mathematical operation it
carries out if value of n = 10:
void test1(int n)
{
for(int i=1; i< = n; i++)
{
System.out.println (++i);
}
}

(d)

[1]

[2]

Question 4.
(a)

Fill in the blank numbers from ?1? to ?5? in the following program that attempts to sort an
array A[ ] of 15 integers in descending order using the Bubble sort technique:
[5]
void BubbleSort ( int a[ ] )
{
int t = __?1?__ ;
for(int i = 0 ; i < __?2?__ ; i++)
{
for(int j = 0 ; j < __?3?__ ; j++)
{
if(____?4?____)
{
t = a[j];
___?5?___
a[j+1] = t;
}
}
}
}

2
TSP 002

www.javaforschool.com

(b)

(c)

Write Java statements to:


(i)
convert the String 543 into an Integer.
(ii)
convert the double value 21.5 into a String

[2]

Given the following code, answer the questions that follow:

[3]

class Academic
{
int x,y;
void access( )
{
int a,b;
Academic student = new Academic( );
System.out.println(Object created);
}
}
(i) What is the object name of class Academic?
(ii) Name the class variable used in this program.
(iii) Write the local variable used in this program.

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.

Question 5.
Create a class SalaryCalculation that is described as below:
Class Name

: SalaryCalculation

Data members

: name (String type data)


basicPay, specialAlw, conveyanceAlw, gross, pf, netSalary, AnnualSal
(All double type data)

Member methods

(i) SalaryCalculation( )

- A constructor to assign name of employee (name), basic salary


(basicPay) of your choice and conveyance allowance (conveyanceAlw)
as ` 1000.00
3

TSP 002

www.javaforschool.com

Turn over

(i) void SalaryCal( )

(i) void display( )

to calculate other allowances and salaries as given:


specialAlw = 25% of basic salary.
gross = basicPay + specialAlw + conveyanceAlw.
netSalary = gross - pf.
AnnualSal = 12 months netSalary.
to print the name and other calculations with suitable headings.

Write a program in Java to calculate all the details mentioned above and print them all.

[15]

Question 6.
Write a program to accept a string. Convert the string to uppercase. Count and output the
number of Consecutive letter pairs that exist in the string.
Sample Input:

IT WAS NOT TOUGH FOR HIM TO RESIDE ABOVE THE HILL

Sample Output: Number of consecutive pair of characters = 6

[15]

Question 7.
Using the switch statement, write a menu driven program to:
(i)

Generate and display the following pattern:


1
2
4
1
3
5
2
4
6
8
1
3
5
7
9

(ii)

Input a number and check whether it is an automorphic number or not.


An automorphic number is a number which is present in the last digit(s) of its square.
Example: 25 is an automorphic number as its square is 625 and 25 is present as the last digits

For an incorrect choice, appropriate error message should be displayed.

[15]

Question 8.
Design a class to overload a function print ( ) as follows:

[15]

(a) void print (int x, int y) to print the odd numbers between the x and y.
(b) void print (char ch1, char ch2) to print all the consonants between the 2 characters ch1 & ch2.
(c) void print (char ch, int n) to print the character ch, n number of times in the given format:
Example: If ch = $ and n = 4
Output:
$$$$
$$$
$$
$
4
TSP 002

www.javaforschool.com

Question 9.
Write a program in Java to input a number from the user and print the frequency of each digits present
in it.
Example:
Input

43457973

Output

Digit
4
3
5
7
9

Frequency
2
2
1
2
1

[Note: Only those digits should be printed which are present in the number]

[15]

Question 10.
Write a program in Java to accept the name and weight of 20 of your friends. Store the weight
in a double type array weight [ ] and the name in a String type array name [ ]. Then sort the
name of your friends in ascending order of their weights and finally print the result.

[15]

TSP 002

www.javaforschool.com

Turn over

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 [ ].

SECTION A (40 Marks)


Attempt all questions
Question 1.
(a)
(b)
(c)
(d)
(e)

Name any two Object Oriented Programming (OOP) principles.


Give an example of a Relational operator and a Bitwise Operator.
State one similarity and one difference between while and do-while loop.
What is a compound statement? Give an example.
Find the value of c where x = 0, y = 10.25, z = -5
c =(x + y * z / 2.5)

[2]
[2]
[2]
[2]
[2]

Question 2.
(a)
(b)

[2]

(c)

Explain with the help of an example, the purpose of default in a switch-case construct.
Give an example each for:
(i)
Runtime Error
(ii)
Syntax Error
(iii)
Logical Error
Differentiate between equals ( ) and compareTo ( ) functions.

(d)
(e)

+ 25 /
Write a Java expression for 6
Write Java statements to find if a character variable called var contains an alphabet or not.

[2]
[2]

[2]
[2]

Question 3.
(a)

What is the purpose of:


(i)
new operator
(ii)
this keyword

TSP 001

[2]
[2]
This Paper consists of 4 printed pages.
www.javaforschool.com

Turn over

(b)
(c)
(d)

Write Java statements to check if the 5th element of an array X [10] is divisible by 2.
What is a constructor and what is its use?
Give the output in the following function definitions and also write what mathematical operation it
carries out if value of n = 7:
void test1(int n)
{
for(int x=1; x< = n; x++)
if(n%x = = 0)
System.out.println (x);
}

[2]
[2]

[2]

Question 4.
(a)

(b)

(c)

(d)

Fill in the blank numbers from 1 to 5 in the following program that attempts to find 5n :
class Power
{
int getresult ( __1__)
{
int pro = __2__ ;
for(int i=1; i< = n; i++)
pro = pro * __3__ ;
__4__ ;
}
void callerFunct ( )
{
int p;
__5__ ;
//calling function getresult ( )
System.out.print (p);
}
}

[5]

Determine the errors in the following statements of Java programs and correct them:
(i)
String x = {Java,for,School,Students, Rocks};
(ii)
String s = Apple.equals(Banana);

[2]

Name the package of Java:


(i)
which is imported by default.
(ii)
which contains Scanner class.

[2]

What is String Buffer?

[1]

2
TSP 001

www.javaforschool.com

SECTION B (60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J
environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes
such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.
Question 5.
Define a class Telephone having the following description:
Instance Variables / Data Members:
int prv, pre
- to store the previous and present meter reading
int call
- to store the calls made (i.e. pre prv)
String name
- to store name of the customer
double amt
- to store the amount
double total
- to store the total amount to be paid
Member Methods:
void input ( ) - to input the previous reading, present reading and name of the customer
void cal ( )
- to calculate the amount and total amount to be paid
void display ( ) - to display the name of the customer, calls made, amount and total amount to be paid in the
following format:
Name
Calls Made
Amount
Total Amount
..
..
..

Write a program to compute the monthly bill to be paid according to the given conditions:
Calls made

Rate

Up to 100 calls

No charge

For the next 100 calls

90 paise per call

For the next 200 calls

80 paise per call

More than 400 calls

70 paise per call

However every customer has to pay Rs. 180 per month as monthly rent for availing the service.

[15]

Question 6.
Write a program in Java to input a word. Arrange all the alphabets of the word in ascending order and display
the new word.
Sample Input: BLUEJ
Sample Output: BEJLU

TSP 001

[15]
3
www.javaforschool.com

Turn over

Question 7.
Write a program in Java to accept two integer arrays from the user and join them into a third array. After joining
the arrays, sort the final array in ascending order using Bubble sort technique.
Sample Input: Array A [ ] = {5,6,45,17,2,58,33};
Array B [ ] = {13,25,1,0,7,9};
Sample Output: The final Array after joining is :
The final Array after sorting is :

5 6 45 17 2 58 33 13 25 1 0 7 9
0 1 2 5 6 7 9 13 17 25 33 45 58

[15]

Question 8.
Write a menu driven program to perform the following: (Use switch-case statement)
(a)

To input a word from the user and print it in the following pattern:
J
JA
JAV
JAVA

(b)

To find the sum of the series given below:

S=1+

+ up to n terms (Where x and n are to be inputted from the user)

[Note: ! denotes the factorial of a number which is equal to the product of the numbers
starting from 1 till that number. Example: 5! = 1 x 2 x 3 x 4 x 5]

[15]

Question 9.
Using Scanner class, write a program to input a string and display all those words of the string which begins
with a capital letter and end with a small letter.
Sample Input:

We all love Java for School Students because of its Uniqueness

Sample Output:

We Java School Students Uniqueness

[15]

Question 10.
Write a program to input two numbers and check whether they are Co-Prime number or not. Use the following
two functions in your program:
int calc_hcf (int, int) to find the HCF of the 2 numbers.
int prime (int) to check whether a number is a prime number or not.
[Note: Co-Prime numbers are numbers which are both prime and their HCF is 1]

[15]

4
TSP 001

www.javaforschool.com

Computer Application Question Paper


2005
General Instructions
1. This paper is divided into two Sections.
2. Attempt all questions from Section A and any four questions from Section B.
3. The intended marks for questions or parts of questions are given in brackets [ ].
SECTION A (40 Marks)
Attempt all questions.
Question 1 [10]
(a) Name any two OOP'S principles.
(b) Mention two different styles of expressing a comment in a program.
(c) Which element is num[9] of the array num?
(d) Differentiate between operator and expression.
(e) if m = 5 and n = 2 output the values of m and n after execution in (i) and (ii):i. m = n;
ii. n = m + m/n;
Question 2 [10]
(a) Explain the term for loop with an example.
(b) What is a compound statement? Give an example.
(c) State the difference between Constructor and Method.
(d) State one similarity and one difference between while and do while loop.
(e) Explain, with the help of an example, the purpose of default in a switch statement.
Question 3
(a) What will be the output of the following, if x = 5 initially? [2]
i. 5 *++x
ii. 5*x++
(b) What is the output of the following? [2]
char = 'A';
short m = 26;
int n = c+m;
System.out.println(n);
(c) Explain the meaning of break and continue statements. [3]
(d) (i) What is call by value?
(ii)How are the following passed?
(1) Primitive types (2) Reference types
(e) Enter any two variables through constructor parameters and write a program to swap
and print the values. [4]
(f) What do the following functions return for:- [4]
String x = "hello";
String y = "world";
i. System.out.prinln(x+y);
ii. System.out.println(x.length());
iii. System.out.println(x.charAt(3));
iv. System.out.println(x.equals(y));
(g) Differentiate between toLowerCase() and toUpperCase() methods. [2]
SECTlON - B (60 Marks)

Attempt any fourquestions from this section.


Question 4
Write a class with name employee and basic as its data member, to find the gross pay of
an employee for the
following allowances and deduction. Use meaningful variables.
Dearness Allowance = 25% of the Basic Pay
House Rent Allowance = 15% of Basic Pay
Provident Fund = 8.33% of Basic Pay
Net Pay = Basic Pay + Dearness Allowance + House Rent Allowance
Gross Pay = Net Pay Provident Fund [15]
Question 5
Write a program to input any given string to calculate the total number of characters and
vowels present in the string and also reverse the string :- [15]
Example : INPUT
Enter String : SNOWY
OUTPUT
Total number of characters : 05
Number of Vowels : 01
Reverse string : YWONS
Question 6
Write a program using a function called area() to compute the area of a :
(i) circle(* r2) where = 3.14 (ii) square(side*side) (iii) rectangle ( length*breadth)
Display the menu to output the area as per User's choice. [15]
Question 7
Write a program to bubble sort the following set of values in ascending order:
5,3,8,4,9,2,1,l2,98,16 [15]
OUTPUT : 1
2
3
4
5
8
9
12
16
98
Question 8
Write a program to print the sum of negative numbers, sum of positive even numbers and
sum of positive odd numbers from a list of numbers(N) entered by the user. The list
terminates when the user enters a zero. [15]
Question 9
Write a program to initialize an array of 5 names and initialize another array with their
respective telephone numbers. Search for a name input by the User, in the list. If found,
display "Search Successful " and print the name along with the telephone number,
otherwise display "Search unsuccessful. Name not enlisted". [15]

Computer Application Question Paper


2005
General Instructions
1. This paper is divided into two Sections.
2. Attempt all questions from Section A and any four questions from Section B.
3. The intended marks for questions or parts of questions are given in brackets [ ].
SECTION A (40 Marks)
Attempt all questions.
Question 1 [10]
(a) Name any two OOP'S principles.
(b) Mention two different styles of expressing a comment in a program.
(c) Which element is num[9] of the array num?
(d) Differentiate between operator and expression.
(e) if m = 5 and n = 2 output the values of m and n after execution in (i) and (ii):i. m = n;
ii. n = m + m/n;
Question 2 [10]
(a) Explain the term for loop with an example.
(b) What is a compound statement? Give an example.
(c) State the difference between Constructor and Method.
(d) State one similarity and one difference between while and do while loop.
(e) Explain, with the help of an example, the purpose of default in a switch statement.
Question 3
(a) What will be the output of the following, if x = 5 initially? [2]
i. 5 *++x
ii. 5*x++
(b) What is the output of the following? [2]
char = 'A';
short m = 26;
int n = c+m;
System.out.println(n);
(c) Explain the meaning of break and continue statements. [3]
(d) (i) What is call by value?
(ii)How are the following passed?
(1) Primitive types (2) Reference types
(e) Enter any two variables through constructor parameters and write a program to swap
and print the values. [4]
(f) What do the following functions return for:- [4]
String x = "hello";
String y = "world";
i. System.out.prinln(x+y);
ii. System.out.println(x.length());
iii. System.out.println(x.charAt(3));
iv. System.out.println(x.equals(y));
(g) Differentiate between toLowerCase() and toUpperCase() methods. [2]
SECTlON - B (60 Marks)

Attempt any fourquestions from this section.


Question 4
Write a class with name employee and basic as its data member, to find the gross pay of
an employee for the
following allowances and deduction. Use meaningful variables.
Dearness Allowance = 25% of the Basic Pay
House Rent Allowance = 15% of Basic Pay
Provident Fund = 8.33% of Basic Pay
Net Pay = Basic Pay + Dearness Allowance + House Rent Allowance
Gross Pay = Net Pay Provident Fund [15]
Question 5
Write a program to input any given string to calculate the total number of characters and
vowels present in the string and also reverse the string :- [15]
Example : INPUT
Enter String : SNOWY
OUTPUT
Total number of characters : 05
Number of Vowels : 01
Reverse string : YWONS
Question 6
Write a program using a function called area() to compute the area of a :
(i) circle(* r2) where = 3.14 (ii) square(side*side) (iii) rectangle ( length*breadth)
Display the menu to output the area as per User's choice. [15]
Question 7
Write a program to bubble sort the following set of values in ascending order:
5,3,8,4,9,2,1,l2,98,16 [15]
OUTPUT : 1
2
3
4
5
8
9
12
16
98
Question 8
Write a program to print the sum of negative numbers, sum of positive even numbers and
sum of positive odd numbers from a list of numbers(N) entered by the user. The list
terminates when the user enters a zero. [15]
Question 9
Write a program to initialize an array of 5 names and initialize another array with their
respective telephone numbers. Search for a name input by the User, in the list. If found,
display "Search Successful " and print the name along with the telephone number,
otherwise display "Search unsuccessful. Name not enlisted". [15]

Computer Application Question Paper


2007
General Instructions:
1. This Paper is divided into two Sections.
2. Attempt all questions from Section A and any four questions from Section B.
3. The intended marks for questions or parts of questions are given in brackets.
SECTION A (40 Marks)
Attempt all questions
Question 1 [10]
(a) Name two types of Java programs.
(b) Define Instance Variable. Give an example of the same.
(c) Differentiate between Binary Search and Linear Search.
(d) Assign the value of pie (i.e. 3.142) to a variable with requisite data type.
(e) Explain with an example the if-else-if construct.
Question 2 [10]
(a) Differentiate between Formal Parameter and Actual Parameter.
(b) Why do we need a constructor as a class member?
(c) Explain the term type casting.
(d) Name the following:i. A package that is invoked by default.
ii. A key word, to use the classes defined in a package.
(e) Name the class that is used for different mathematical functions. Give an example of a
mathematical function.
Question 3
(a) State the difference between = and = =. [2]
(b) Write an equivalent Java syntax for the following expression:- a = 0.05 2y3 / x y
[2]
(c) Rewrite the following using Ternary operator
if (income < = 10000 )
tax = 0 ;
else
tax = 12 ; [2]
(d) Write a statement for each of the following:i. Store a number 275 as a String
ii. Convert the string to a numeric value
iii. Add it to the existing total of 1000 to update the total. [3]
(e) (i) What is the role of the keyword void in declaring functions?
(ii) If a function contains several return statements, how many of them will be executed?
(iii) Which OOP principle implements function overloading? [3]
(f) What is the output of the following:i. System.out.println ("four :" + 4 + 2);
System.out.println (" four : "+(2+2)); [2]
ii. String S1 = "Hi";
String S2 = "Hi"; String S3 = "there";
String S4 = "HI";
System.out.println(S1 + "equals" + S2 + "" + S1.equals(S2));
System.out.println(S1 + "equals" + S3 + "" + S1 .equals(S3));

System.out.println(S1 + "equals" + S4 + "" + S1 .equals(S4));


System.out.println(S1 + "EqualIgnoreCase" +S4 + "" +
S1.EqualIgnoreCase(S4)); [4]
(g) Evaluate the following expressions, if the values of the variables are a = 2, b=3 and
c=9
i. a (b++) * ( c)
ii. a * (++b) % c [2]
SECTION B (60 Marks)
Question 4
Define a class salary described as below:Data Members : Name, Address, Phone, Subject Specialization, Monthly
Salary, Income Tax.
Member methods : (i) To accept the details of a teacher including the monthly
salary.
(ii) To display the details of the teacher.
(iii) To compute the annual Income Tax as 5% of the annual
salary above Rs.1,75,000/-.
Write a main method to create object of a class and call the above member method. [15]
Question 5
Write a program to compute and display the sum of the following series:- [15]
1+2
12
+
1+2+3
123
+.......+
1 + 2 + 3 + 4....n
1 2 3 4....n
Question 6
Write a program to initialize the given data in an array and find the minimum and
maximum values along with the sum of the given elements.
Numbers : 2 5 4 l 3
Output : Minimum value : l
Maximum value : 5
Sum of the elements : [15]
Question 7
Write a program to enter a sentence from the keyboard and count the number of times a
particular word occurs in it. Display the frequency of the search word.
Example:
INPUT:
Enter a sentence : the quick brown fox jumps over the lazy dog.
Enter a word to be searched : the
OUTPUT:
Searched word occurs : 2 times. [15]
Question 8
Using a switch statement, write a menu driven program to convert a given temperature
from Fahrenheit to Celsius and vice versa. For an incorrect choice, an appropriate error
message should be displayed. [15]

(HINT : C = 5 9 (F 32) and F = 1.8 C + 32


Question 9
Write a program using a method Palin( ), to check whether a string is a Palindrome or
not. A Palindrome is a string that reads the same from left to right and vice versa.
E.g. MADAM, ARORA, ABBA, etc. [15]