ICSE Class 10 Computer Application Solved Question Paper Year 2009

Answer 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 on the head of this paper is the time allowed for writing the answer.
This Paper is divided into Sections.
Attempt all questions from Section A and any four 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

Marks [2]

Why is a class called factory of objects?Ans. The class is an object maker or object factory. It contains all the statements needed to create an object, its attributes, as well as the statements to describe the operations that the object will be able to perform.

Marks [2]

State the difference between a boolean literal and a character literal.Ans.

Boolean Literal

Character Literal

The Boolean type has two values, represented by the literals true and false, formed from ASCII letter.

A character literal is one character enclosed in single quotes, as in ‘a’.

Marks [2]

What is the use and syntax of a ternary operator?Ans. Ternary operator: Ternary operator is a shortcut conditional operator (?:) that stores a value depending upon a condition. This operator requires three operators.
Syntax
expression 1 ? expression 2 : expression 3
e.g.
c = a >b?a: c;

Marks [2]

Write one word answer for the following:

A method that converts a string to a primitive integer data type.

The default initial value of a boolean variable data type.

Ans.

parse (parse)

false

Marks [2]

State one similarity and one difference between while and for loop.Ans. Similarity: Both are looping statements.
Difference: ‘for’ is used to repeat some Java statements when the numbers of iterations are known whereas while statement is used to repeat when number of iterations are not known.

Question 2

Marks [2]

Write the function prototype for the function “sum” that takes an integer variable (x) as its argument and returns a value of float data type.Ans. public static float sum (int x).

Marks [2]

What is the use of the keyword this?Ans. When a member function is called, It is automatically passed on implicit argument that is a reference to the object that invoked the function.

Marks [2]

Why is a class known as composite data type?Ans. A class is a construct that binds one or more primitive types together to be used as a single data type.
These primitive types integrated in the class can be of primitive type variables or primitive type methods.

Marks [2]

Name the keyword that:

is used for allocating memory to an array,

causes the control to transfer back to the method call.

Ans.

Subscript or Index

return

Marks [2]

Differentiate between pure and impure function.Ans.

Pure function

Impure function

A function that only returns a value

without bringing about any change in the

values being passed to it.

e.g.

static Boolean max (int a, int h)

{

if(a==b)

return true;

else

return false;

}

A function that brings about a change in

the argument that it receives.

e.g.

static void count(int n)

{

n.counter = n.counter;

}

Question 3

Marks [4]

Write an expression for

Ans. Math,pow((a+b),n)/(Math.sqrt(3)+b).

Marks [2]

The following is a segment of a program.

x = 1;y = 1;
if(n&gt;0)
{
x = x + l;
y = y - 1;
}

What will be the value of x and y, if n assumes a value

1

0?

Ans.

n = 1
x = 2, y = 0

n = 0
x= l, y= 1

Marks [2]

Analyze the following program segment and determine how many times the body of loop will be executed (show the working).

When there are multiple definitions with the same function name, what makes them different from each other?Ans. When there are multiple definitions with the same name, argument types make them different from each other.

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 description/Mnemonic Codes
so that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.

Question 4

Marks [15]

An electronics shop has announced the following seasonal discounts on the purchase of certain items.

Purchase Amount in Rs.

Discount on Laptop

Discount on Desktop PC

0-25000

0.0%

5.0%

25001 – 57000

5.0%

7.5%

57001 – 100000

7.5%

10.0%

More than 100000

10.0%

15.0%

Write a program based on the above criteria, to input name, address, amount of purchase and the type of purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be paid by a customer along with his name and address.
(Hint: discount = (discount rate/100)* amount of purchase
Net amount = amount of purchase – discount)Ans.

Question 8

Write a menu driven program to accept a number from the user and check whether it is a ‘BUZZ’ number or to accept any two numbers and print the ‘GCD’ of them.

A BUZZ number is the number which either ends with 7 or divisible by 7.

GCD (Greatest Common Divisor) of two integers is calculated by continued division method. Divide the larger number by the smaller; the remainder then divides the previous divisor. The process is repeated till the remainder is zero. The divisor then results the GCD.