ICSE Computer Applications Question Paper 2009 Solved for Class 10

ICSE Computer Applications Previous Year Question Paper 2009 Solved for Class 10

ICSE Paper 2009
COMPUTER APPLICATIONS

(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) Why is a class called a factory of objects ? [2]
(b) State the difference between a boolean literal and character literal. [2]
(c) What is the use and syntax of a ternary operator ? [2]
(d) Write one word ansiver for the following :
(i) A method thatyconverts a string to a primitive integer data type. [2]
(ii) The default initial value of a boolean variable data type. [2]
(e) State one similarity and one difference between while and for loop. [2]

Answer:
(a) The factory of objects means a factory that produces the objects. Class is said to be an object factory because the class, basically is an object maker. It contains all the attributes to create an object. It also contains the statements that describe the operation that the object is going to perform.

(b) The value true or false that is stored within a boolean variable is called boolean literal or a boolean constant, whereas any possible character that can be typed or generated through a keyboard and stored within single quotation marks is called character literal or character constant.
For example :
boolean s=true; //here true is a boolean literal
char ch=‘A’; //here ‘A’ is a character literal

(c) A ternary operator is a type of operator that requires three operands. It is also known as conditional operator, that is represented by symbol. The use of a ternary operator is to handle the conditional statements that will produce one result out of two. It is an alternative of if-else statement.
The syntax of a ternary operator is :
Condition ? Operand 2: Operand 3
Ex: System.out.println(a>b?a:b);

(d) (i) int x = Integer.valueOf (s);
(ii) The default initial value of a boolean variable data type is false.

(e) One similarity between while and for loop is that they both are entry controlled loop i.e. they both will check the condition for true or false. If the condition is true then only the entry within the loop is permitted.
One difference between while and for loop is that while loop is best suited for those situations where the number of iterations are not known in advance where as for loop is best suited for those stations where the number of iterations are already known in advance.

Question 2:
(a) 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. [2]
(b) What is the use of the keyword this ? [2]
(c) Why is class known as composite data type ? [2]
(d) Name the keyword that :
(i) is used for allocating memory to an array. [2]
(ii) causes the control to transfer hack to the method call. [2]
(e) Difference between pure and impure functions. [2]

Answer:
(a) float sum(int x)
(b) The keyword ‘this’ is used as a reference for global variable i.e. variable declared outside the block. If the two variables i.e. one inside the function and one outside the function are same and you wish to refer the outside variable then ‘this’ keyword is used. We know that it is not allowed to declare the two variables with the same name in a same scope. But it is possible to declare two variables in the same class with the same name by declaring them in two different scopes. From the inside scope if you wish to refer the variable in the outside scope then use ‘this’ keyword. See the following code to understand ‘this’ keyword.
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-1
The above code will reference to the outside (global) variable is provided through ‘this’ keyword.

(c) The class is known as composite/flata type because a composite or reference data type are the data elements whose value is an address. The values in a composite data type cannot be assigned directly. It is assigned with the help of a reference. For example, if there are two public integer variables in class XYZ as A and B then the value to those variables cannot be assigned directly. They can be assigned with the help of the following reference:
XYZ obj1; //creating an object of XYZ class
Obj1.A=10; //referencing the variable.
Obj1.B=20;
Thus class is a composite data type because it requires a reference to use its attributes.

(d) (i) new
(ii) return

(e) Difference between pure and impure functions:
Pure Functions: A function is” said to be a pure function when it return information about the state of an object. These functions contain a return statement in order to pass back the result generated by the module or function.
Impure Functions: A function is said to be an impure function when they change the state of the variables but they do not return any value. They do not have any return statement. Their function header bears Void’ as a return type. It is also known as Mutator function.

Question 3:
(a) Write an expression for \(\frac { { (a+b) }^{ n } }{ \sqrt { 3 } +b } \).

(b) The following is a segment of program:
x = 1 ; y = 1;
if(n>0)
{
x=x+1;
y=y-1;
}
What will be the value of x and y, if n assumes a value (i) 1 (ii) 0 ? [2]

(c) Analyze the following program segment and determine how many times the body of loop will be executed (show the working).
x=5; y=50;
while (x<=y)
{
y=y/x;
System.out.println(y);
} [2]

(d) When there are multiple definitions with the same function name, what makes them different from each other ? [2]

(e) Given that int x[][]={{2,4,6),{3,5,7}};
What will be the value of x[1][0] and x [0] [2] ? [2]

(f) Give the output of the following code fragment: [3]
When (i) opn=‘b’ (ii) opn=‘x’ (iii) opn=‘a’
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-2

(g) Consider the following code and answer the questions that follow:
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 the program.
(iii) Write the local variable used in the program.
(iv) Give the type of function used and its name. [4]

(h) Convert the following segment into an equivalent do loop. [3]
int x, c;
for (x=10, c=20; c=10; c=c-2)
x++;

Answer:
(a) Math.pow((a+b),n)/((Math.sqrt(3)) + b);

(b) If the value of n assumes to be 1 then the value of x will be 2 and y will be 0;
If the value of n assumes to be 0 then the value of x will be 1 and y will be 1;

(c) Working of a loop.

Loop executionValue of x and yCondition (x<=y)Output
First time5 and 50Truey=50/5; i.e. 10 output=10
Second time5 and 10Truey=10/5; i.e. 2 Output = 2
Third time5 and 2FalseExit the loop

Thus with the above table, it is clear that the loop will executed times and produces the output 10 and 2 respectively. On the third time it becomes false and the iteration stops.

(d) The multiple definitions with the same function name is called Function Overloading. The only difference among those functions is their parameter list which helps the compiler to recognize which function is being executed.

(e) The value of x[1][0] is 3 and the Value of x[0][2] is 6.

(f) (i) Output when the value of opn =‘b’ :
Object Oriented Robust and Secure
(ii) Output when the value of opn =‘x’ :
Wrong Input
(iii) Output when the value of opn = ‘a’ :
Platform Independent

(g) (i) The name of the object of class academic is student.
(ii) The class variables used; in the program are x and y.
(iii) The local variables used in the program are a and b.
(iv) The function is of impure type and its name is access ().

(h) int x, c;
x=10;
c=20;
do
{
x++;
c=c-2;
}while(c>=10);

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 Algorithm» are not required.

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

Purchase Amount in Rs.Discount on LaptopDiscount on Desktop PC
0—250000.0%5.0%
25001—570005.0%7.5%
57001—1000007.5%10.0%
More than 10000010.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)  [15]

Answer:
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-3
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-4

Question 5:
Write a program to generate a triangle or an inverted triangle till n terms based upon the user’s choice of triangle to be displayed.
Example 1:
Input : Type 1 for a triangle and
Type 2,for an inverted triangle
1
Enter the number of terms
5
Output :
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Example 2:
Input : Type 1 for a triangle and
Type 2 for an inverted triangle
2
Enter the number of terms
6
Output :
6 6 6 6 6 6
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1

Answer:
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-5

Question 6:
Write a program to input a sentence and print the number of characters found in the longest word of the given sentence.
For example, if S=“India is my country” then the output should be 7. [15]

Answer:
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-6
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-7

Question 7:
Design a class to overload a function num_calc() as follows :
(a) void num_calc (int num, char ch) with one integer argument and one character argument, computes the square of integer argument if choice ch is ‘s’ otherwise finds its cube.
(b) void num_calc (int a, int b, char ch) with two integer arguments and one character argument. It computes the product of integer arguments if ch is ‘p’
else adds the integers.
(c) void num_calc (String s1, String s2) with two string arguments, which prints whether the strings are equal or not. [15]

Answer:
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-8
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-9

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) A BUZZ number is the number which either ends with 7 or divisible by 7.
(b) 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. [15]

Answer:
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-10
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-11
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-12
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-13

Question 9:
The annual examination results of 50 students in a class is tabulated as follows :
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-14
Write a program to read the data, calculate and display the following :
(a) Average marks obtained by each student.
(b) Print the roll number and average marks of the students whose average mark is above 80.
(c) Print the roll number and average marks of the students whose average mark is below 40. [15]

Answer:
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-15
icse-previous-papers-with-solutions-for-class-10-computer-applications-2009-16

ICSE Class 10 Computer Applications Previous Years Question Papers

Leave a Comment