Nothing Special   »   [go: up one dir, main page]

ICSE Class 9 Sample Paper 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

ICSE Question Paper – Sample Paper 1

Class IX

----------------------------------------------------------------------------------------------------------------

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)


Answer all questions from this Section

Q1 (i) int var = „A‟; [2]


What is the value of var?
(ii) Name the package that contains wrapper classes.

Q2 Identify whether they are primitive or non-primitive types [2]


(i) String (ii) arrays (iii) char (iv) classes

Q3 System.out.print(“BEST “); [2]


System.out.println(“OF LUCK”);
Choose the correct option for the output of the above statements:
(i) BEST OF LUCK
(ii) BEST
OF LUCK

1
Q4 Write a Java expression for the following: [2]

Q5 Give the output of the following: [2]


(i) Math.floor(-4.7)
(ii) Math.ceil(3.4) + Math.pow(2, 3)

Q6 Convert the following if else if construct into switch case: [2]


if(var == 1)
System.out.println("good");
else if(var == 2)
System.out.println("better");
else if(var == 3)
System.out.println("best");
else
System.out.println("invalid");

Q7 (i) State the number of bytes occupied by char and int data types? [2]
(ii) Write one difference between / and % operator.

Q8 Give the output of the following program segment and also mention the number of times the
loop is executed: [2]

int a,b;
for(a=6,b=4;a<=24;a=a+6)
{
if(a%b==0)
break;
}
System.out.println(a);
or
Q8 What is the value of y after evaluating the expression given below? [2]
y += ++y + y– + –y; when int y = 8.

Q9 What do you mean by Intellectual Property Rights? Name any of its 2 properties? [2]

Q10 What is SPAM? Give 2 ways to prevent SPAM. [2]

2
Q11 The following program is supposed to check the given number is prime or not. Some part
of the program is replaced by ______, with the numbering 1 to 5, fill this part so that program
works correctly. [2]
class checkPrime {
public static void main(String args[]) {
int i, f=0;
int n = Integer.parseInt(args[0]);
for(i=__1__; __2__; i++)
{
if(__3__==0)
{
f=__4__;
break;
}
}
if(f==__5__)
System.out.print(“The given no. “+n+” is a prime number”);
else
System.out.print(“The given no. “+n+” is not a prime number”);
} }
or
Q11 Give the output and show the dry run. [2]
public static void abc()
{
int x=1, i=2;
do
{
x*=i;
}while(++i<=5);
System.out.println(x);
}

Q12 What is the output of the following? [2]


char c = „A‟;
short m = 26;
int n = c + m;
System.out.println(n);

Q13 Analyse the given program segment and answer the following questions: [2]
for(i = 3; i <=4; i++)

3
{
for(j=2; j<i; j++)
{
System.out.print(""),
}
System. out.println("WIN");
}
i. How many times does the inner loop will execute?
ii. Write the output of the program segment.

Q14 Give the output of the following program. [2]


int i,j;
for (i=0; i<4; i++)
{
for (j=i; j>=0; j--)
System.out.print(j);
System.out.println();
}

Q15 What will be the output of the following code? [2]


int m=2
int n=15;
for(int i=1;i<5;i++)
m++; - - n;
System.out.println("m="+m);
System.out.println("n="+n);

Q16 What do you mean by type conversion? How is implicit conversion different from explicit
conversion? [2]

Q17 What is difference between ASCII and Unicode. Which one does Java uses? What are
ASCII codes for small letters? [2]

Q18 Why is Java called as Platform Independent Language? [2]

Q19 What is difference between Local, Instance, Global and Class Variables? [2]

Q20 What is the difference between if and switch? [2]

4
SECTION B (60 MARKS)
Attempt any 4 programs

Q1) A library charges fine for books returned late. [15]


Following are the fines:
first five days 40 paisa per day
Six to ten days 65 paisa per day
above 10 days 80 paisa per day.
Design a program to calculate the fine assuming that a book is returned N days late.

Q2 Generate the pattern [15]


*
***
*****
*******
*****
***
*
Q3 WAP to accept a number and check whether the number is perfect number or not. A number
is called perfect number, if the sum of all factors (except number itself) of the number is equal to
that number. (For e.g. 6 is a perfect number. Factors are 1, 2 & 3 and the sum is 1+2+3 = 6.)
[15]

Q4 Find the sum of the series. [15]


S = (X+1)2+(X+2)3+(X+3)4+(X+4)5+…………… +(X+N)N+1

Q5 The volume of solids, viz. cuboid, cylinder and cone can be calculated by the Formula:
[15]

1. Volume of a cuboid
2. Volume of a cylinder
3. Volume of a cone ( ) ( )
Using a switch case statement, write a program to find the volume of different
solids by taking suitable variables and data types.

Q6 A special two-digit number is such that when the sum of its digits is added to
the product of its digits, the result is equal to the original two-digit number.

Example: Consider the number 59. [15]


Sum of digits = 5 + 9 = 14

5
Product of digits = 5 * 9 = 45
Sum of the sum of digits and product of digits = 14 + 45 = 59

Write a program to accept a two-digit number. Add the sum of its digits to the
product of its digits. If the value is equal to the number input, then display the
message "Special 2 - digit number" otherwise, display the message "Not a special
two-digit number".

You might also like