0% found this document useful (0 votes)
11 views

ICSE Computer Application Sample Paper2

This document is a sample paper for Class X Computer Applications, consisting of two sections: Section A with 40 marks and Section B with 60 marks. It includes various questions related to Object-Oriented Programming, Java programming concepts, and practical programming tasks. Students are required to attempt all questions in Section A and any four from Section B, with a total duration of 2 hours.

Uploaded by

Armin Shroff
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

ICSE Computer Application Sample Paper2

This document is a sample paper for Class X Computer Applications, consisting of two sections: Section A with 40 marks and Section B with 60 marks. It includes various questions related to Object-Oriented Programming, Java programming concepts, and practical programming tasks. Students are required to attempt all questions in Section A and any four from Section B, with a total duration of 2 hours.

Uploaded by

Armin Shroff
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

http://www.icseguess.

com/

Sample Paper – 2011


Class – X
Subject – Computer Applications
(Theory)

Time: 2 hours Full Marks: 100

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 at the head of the paper is the time allowed for writing the answers.

This paper is divided in to two Sections. Attempt all questions in Section A and any four
questions from Section B. The intended marks for the questions or parts thereof are given in
brackets([ ]).

Section A (40 marks)


Attempt all questions

1. (a) What are the features of Object - Oriented Programming (OOP)? [5 x 2 = 10]

(b) Which feature of OOP can be characterized by the phrase “one name many
interface”? Explain.

(c) What will be the output of the following?


String letters = “abcdefghijklmnabcdefghijklmn”;
String output = “substring method with one argument” + letters.substring(12);
output += “substring method with two arguments” + letters.substring(3, 8);
System.out.println(output);

(d) Rewrite the given statement using ternary operator


if ( a > b )
p = a – b;
else
p = b – a;

(e) What is bytecode?

2. (a) How can a method be overloaded in Java? [5 x 2 = 10]

(b) Consider the following class:

public class IdentifyMyParts {


public static int x = 7;

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com
http://www.icseguess.com/

public int y = 3;
}

(i) Identify the fields; (ii) Identify the instance variables.

(c) Create an array of arrays containing three arrays. The first array contains 4
elements, the second one has two and the third one has three elements.

(d) What are the different types of constructors used in a class?

(e) What is the difference between break and continue statements in Java?

3. (a) Given the following code what should come at the blank space so that the output is
“Outer s”? Justify your answer. [2]

class Test {
public static void main(String[] args) {
Test test = new Test();
test.new InnerTest ( ).f ( );
}
final String s = “Outer s”;
class InnerTest {
Sring s = “Inner s”;
void f ( ) {
System.out.println(Test._____________ );
}
}
}

(b) Assume you have written some classes. Belatedly, you have decided that they
should be split into three packages as listed below. Furthermore, assume that the
classes are in the default package (they have no package statements). [5]

Package Names and Class Names


(i) Package Name Class Name

mygame.server Server
mygame.shared Utilities

mygame.client Client

Which line of code will you need to add to each source file to put each class in the
right package?

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com
http://www.icseguess.com/

(ii) To adhere to the directory structure, you will need to create some
subdirectories in the development directory and put source files in the correct
subdirectories. What subdirectories must you create? Which subdirectory does each
source file go into?

(c) You would like to print the message “No errors.” If the String reference variable s
is neither null nor reffering to a zero length String. What would appear in the blank
space? [3]

if ( ___________ ___________ ___________ )

System.out.println (“No errors.”);

4. (a) What is the result of compiling and running the following program? Justify your
answer. [4]

class SuperBase { void print ( SuperBase a ) { System.out.print (“Super”);}}


class Base extends SuperBase { void print (Base b) { System.out.print (“Base”);}}
class Derived extends Base { static void print (Derived c) { System.out.print
(“Derived”);}}
class Test {
public static void main ( String [ ] args ) {
SuperBase a1 = new SuperBase ( );
SuperBase b1 = new SuperBase ( );
Base c1 = new Derived ( );
a1.print (new Base ( ));
b1.print (new Derived ( ));
c1.print (new Derived ( ));
}
}

(b) State whether the following is true or false with proper justification. [2]

In the expression below, the value of operand c is not evaluated if the value of the
operand b is false.

boolean a = b && c;

(c) What is the result of compiling and running the following program? Justify your
answer. [2]

class Test {
public static void main (String[ ] args) {
int [ ] a = new int [5];

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com
http://www.icseguess.com/

System.out.println (a[3]);
}
}

(d) Rewrite the following code snippet making necessary correction(s), if any error
exists. [2]

float a = 3.7 + 5.8;


System.out.println (a);

Section B (60 marks)


Attempt any 4 questions from this section

The answer in this Section should consist of the programs in either BlueJ environment any
other program environment or 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.

5. Write a program to accept a String from the user and display the second longest word in
the String. e.g., Input: I read in class ten.
Output: The second longest word is read.
[15]

6. DTDC courier service charges for the transportation of any parcel within eastern zone as
follows:
Upto 100 gm. : Rs. 30
For each additional 50 gm. Or part thereof : Rs. 10
Write a program to calculate the charge of a parcel taking the weight of a parcel as input
from the user. [15]

7.Write a program to print the following pattern:

77777 5 [15]
6666 4
555 3
44 2
3 1

8. You can encode or decode a string in many ways. One of he simplest ways to replace
each letter by a letter at a fixed distance ahead or behind in the alphabet is assumed to
wrap around ( i.e. ‘A’ follows ‘Z’).

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com
http://www.icseguess.com/

e.g., given string: JAVA and encode = 2, means each character moves 2 characters
ahead. Thus, new string: “LCXC”.
Write a program in Java to accept a string and display the new string after encoding =
- 3, means each character moves three characters behind.
Sample input: ABACUS
Sample output: XYXZRP [15]

9. Write a program to store 20 different names along with the corresponding telephone
numbers. Enter a name from the console and search whether the name is present or not. If
the name is present, display the name along with the phone number, otherwise display an
appropriate message for the name not found. [15]

10. Write a program to compute and display the sum of the following series:

S = (1)/(1!) – (1 + 2)/(1! * 2!) + (1+2 +3)/(1! * 2! * 3!) - (1 + 2 + 3 + 4)/(1! * 2! * 3! *


4!) + ………..(1 + 2 + 3 + 4 + ….+ n)/(1! * 2! * 3! * 4! * ….. * n!)

where n is any integer value taken from the user as input. [15]

-------------------------------------------------------------------------------------------------------
www.icseguess.com
Other Educational Portals
www.cbseguess.com | www.ignouguess.com | www.dulife.com | www.magicsense.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy