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

Mock 3

The document outlines an ICSE Computer Applications theory exam for Grade X, consisting of two sections: Section A with 40 marks requiring all questions to be attempted, and Section B with 15 marks each where any four questions can be chosen. It includes various programming-related questions covering topics like visibility of methods, algorithms, and Java programming tasks. Additionally, it specifies the exam format, including reading time and answer requirements.

Uploaded by

anushara26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Mock 3

The document outlines an ICSE Computer Applications theory exam for Grade X, consisting of two sections: Section A with 40 marks requiring all questions to be attempted, and Section B with 15 marks each where any four questions can be chosen. It includes various programming-related questions covering topics like visibility of methods, algorithms, and Java programming tasks. Additionally, it specifies the exam format, including reading time and answer requirements.

Uploaded by

anushara26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

COMPUTER APPLICATIONS

( THEORY )

( Two Hours )

GRADE:X ICSE MAX. 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 in to two sections.

Attempt all questions from Section A and any four questions from Section B.

The intended marks are indicated against each question.

Section A - 40 marks
[Attempt all questions]

QUESTION 1:

a) What is meant by private visibility of a method? [2 marks]

b) Mention any two attributes required for class declaration. [2 marks]

c) Explain instance variable. Give an example. [2 marks]

d) Name the following: [2 marks]

i) A package that is invoked by default.

ii) If a function contains several return statements, how many of them will be executed?

e) What are library classes ? Give an example. [2 marks]

QUESTION 2

a) Name the search or sort algorithm that: [2 marks]

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

ii) At each stage, compares the sought key value with the key value of middle element of the
array.
b) What is the role of the keyword void in declaring functions? [2 marks]

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

d) What are the two ways of invoking functions? [2 marks]

e) Give the prototype of a function search which receives a sentence sentnc and a word wrd and
returns 1 or 0 ? [2 marks]

QUESTION 3

a)Find the output of the following program segment, when: [2 marks]

i) val = 500 ii) val = 1600

int val, sum, n=550;

sum = n + val > 1750 ? 400 : 200;

System.out.println(sum);

b)What will be the result stored in x after evaluating the following expression?[2 marks]

int x=4; x+=(x++) + (++x) + x + --x

c) In the program given below, state the name and the value of the following:- [4 marks]

i) method argument or argument variable

ii) class variable

iii) local variable

iv) 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); }

void sampleMethod(int n) {

System.out.println(n);

System.out.println(y); } }

d) Give the output of the following:- [2 marks]

double b=-15.6;

double a=Math.rint(Math.floor(b));

double c=Math.ceil(Math.abs(b));

System.out.println("a="+c);

e) Give the output of the following: [4 marks]

String n = "Computer Knowledge";

String m = "Computer Applications";

String s="Computer Science";

System.out.println(n.substring (0,8). concat (m.substring(9)));

System.out.println(n.endsWith("e"));

System.out.println(s.indexOf("Computer,5"));

System.out.println(s.compareTo(n));

f)Find out the errors in the following program snippet:- [2 marks]

int i=10

switch(i)

case1:j=i*2;

break;

case2:j=i+2;

break;

case3:j=i-2;
break; }

g)Use if construct to resolve the given ternary operator: [2 marks]

i)String c=(a>0)?(a%2==0)?”Positive odd”:”Postive even”:”Negative number”;

h)Predict the output:- [2 marks]

int p[]={3,5,7,9,11,13,15,17,19,21};

for(i=8;i>=0;i=i-2){

System.out.println(p[i]);

Section B
(Attempt any four questions)
QUESTION 4 [15 marks]

A prominent builder has announced the launch of a property which starts at 4000 Rs per sft
(square foot) for the 1st floor floor flat. The price per sft increases by Rs. 50 per floor up to and
including the 10th floor. From the 10th floor upwards, the price per sft increases by Rs. 100 per
floor. There are two types of flats: 2BHK and 3BHK. The 2BHK flats have a saleable area of
1500 sft, and the 3BHK flats have a saleable area of 2000 sft. The building has 20 floors. Write a
program that prints the rate of each floor, and the cost of each type of flat for each of the floors, in
the format shown below:

FLOOR NO. RATE PER SFT. PRICE OF 2BHK PRICE OF 3BHK

1 … … …

2 … … …

QUESTION 5 [15 marks]

Write a program that asks the user to enter a word, and print all the UNIQUE two-letter
combinations that exist of that word. [15 marks]
Sample Input:-goOd

Sample Output:-GO GD OG OO OD DG DO

QUESTION 6 [15 marks]

Write a Program in Java to input a number and check whether it is a Disarium Number or not.

Note: 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+53 = 135, some other DISARIUM are 89, 175, 518 etc)

QUESTION 7 [15 marks]

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*digit1 +

2*digit2 + 3*digit3 + 4*digit4 + 5*digit5 + 6*digit6 + 7*digit7 + 8*digit8 + 9*digit9 +

10*digit10 is divisible by 11.

Example: For an ISBN 1401601499

Sum=1*1 + 2*4 + 0*0 + 4*1 + 5*6 + 6*0 + 7*1 + 8*4 + 9*9 + 10*9 = 253 which is divisible by
11.

Write a program to:

(i) input the ISBN code as a 10-digit number

(ii) If the ISBN is not a 10-digit number, 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”.

QUESTION 8 [15 marks]

A sentence in the Special Fashion can be printed by taking two integers (not beyond total number
of words in the sentence or less than 1). These integers tell the word number of the sentence.
Replace only those words present at those given integer places by the next character in a circular
fashion according to the English Alphabets. If both the integers are same then replace only one
word. let us consider the following examples:

Input Sentence: He has good Books.

Input Integers: 2, 4

Output Sentence: He ibt good Cpplt.

(i.e. word number 2 and 4 have been replaced by the next characters in a circular fashion)

QUESTION 9 [15 marks]

Write a program that asks the user to enter an integer (N). Create a single-dimensional array of N
double values. Ask the user to enter the N double values to populate this array. Sort this array in
reverse (descending) order using the selection sort method, and print the same on a single line,
each element separated by a space.

*******************

You might also like