You are on page 1of 3

Half Yearly Examinations 2012 - 2013

Subject: Computer Applications


Class - IX
Duration: 2 Hours

Maximum Marks: 100

Section A (40 Marks)


(Attempt all the questions from this section)
Question 1
a)
b)
c)
d)
e)

[2 x 5 =10]

Define data abstraction.


Differentiate between = and = = operator.
Java is a case sensitive language. Explain.
List any four data types of Java with the storage space each of them require.
What is Encapsulation?

Question 2
a)
b)
c)
d)
e)

[2 x 5 =10]

List any four features of Java.


Define bytecode.
What are unary operators? Give any two examples of unary operators.
List all the arithmetical operators present in Java.
Write the syntax of switch - case statement?

Question 3:
(i)

What will be the output of the following program segments?

[6]

String sa[ ] = {"Kamal", "Shubhansh", "Rohit", "Srishti", "Shikha", "Vidushi", "Yashpriya"};


System.out.println( "No. of students : " + sa.length);
System.out.println(Math.max(sa[2].length(), sa[6].length()));
System.out.println(sa[1].length() / sa[5].length());
System.out.println(sa[1].substring(3) + sa[2].substring(5) + sa[6].substring(4,7));
(ii)

Write the output of the following program segments?


int ch = 2;
switch(ch)
{
case 1 : System.out.print(One);
case 2 : System.out.print(Two);
case 3 : System.out.print(Three); break;
case 4 : System.out.print(Four);
default : System.out.print(Default);
}

Page 1 of 3

[2]

Section B (60 Marks)


(Attempt any four questions from this section)
The answers in this section should consist of the program in BlueJ environment with Java. Each program should
be written using Variable descriptions / Mnemonics Codes such that the logic of the program is clearly depicted.

Question 4

[15]

Write a program to accept the marks of a student in 5 subjects, find the percentage marks and based
on the same display one of the following messages:
Percentage Marks
>= 75
>= 60 and < 75
>= 45 and < 60
>= 40 and < 45
< 40

Message
1st Division with Distinction
2nd Division
3rd Division
4th Division
Failed

Question 5

[15]

Write a program to generate the series of first n Fibonacci numbers.


0

13

21 n terms

Question 6

[15]

Write a program to accept a number between 1 to 7 from the user and display the corresponding
colour from the Rainbow colours using switchcase.
[Sequence of Rainbow colours : Violet, Indigo, Blue, Green, Yellow, Orange & Red]
Question 7

[15]

Write a function to find out the simple interest and compound interest, if the principle amount, rate
and time are passed as parameters to the function.
Question 8

[15]

Write a program to check whether a given number is a palindrome number or not.


Question 9

[15]

Write a program to accept a number, find the sum and product of its digits and display those.
For example:
Input:
Output:

396556
Sum of digits : 34
Product of digits : 24300

Page 2 of 3

Page 3 of 3

You might also like