Class IX Final Exam 2015

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

ACME PUBLIC SCHOOL

II term Examination
Computer Science
Class :IX
Time: 2 hours M.M.: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
Section B. The intended marks for the questions or parts thereof are given in
brackets [ ].

PartI(20 Marks)
Section – A
[Attempt all the questions from this section.]

Question 1: [5*2=10]

(a) Difference between if and switch statement.


(b) State the difference between entry controlled loop and exit controlled loop.
(c) Name two jump statement and their uses.
(d) what do you mean by nested loop?
(e)write down the use of nextInt() method?
Question 2: [5*2=10]
(a) How to accept a character from scanner object?
(b) Explain with the help of an example ,the purpose of default in a switch
statement.
(c) Predict the output of the following snippet:
int 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
(d) Rewrite the following program segment using while instead of for statement.
int f = 1,i;
for(i = 1; i<= 5; i++)
{
f = f*i;

}
System.out.println(f);
(e) How will you terminate outer loop from the block of the inner loop?
Question 3: [10*2=20]

(a) Distinguish between a continuous loop and a step loop.


(b) What is the value of ctr when the iteration process given below executed?
int ctr = 0;
for(int i = 1; i<5; i++)
{
for(int j =i; j<= 5; j = j+2)
{
System.out.println(++ctr);
}
}
(c) Write a program to accept any 10 numbers .Print the sum of only the
negative numbers.
(d) Differentiate between break and continue.
(e) Write the advantage of input through Scanner class.
(f) Define nextInt() and Boolean hasNextInt() method.
(g) How to protect data on Internet?
(h) What is compound statement ? Give an example.
(i) Write a program to find the sum of the series :
S = 1/2 +1/4+ 1/8+1/16+…………n terms
(j) State difference between while and do-while loop.

Part II(60 Marks)

[Attempt any four questions from this section]


Question 4: Write a program to calculate and display the factorial of all the
numbers between m to n. [15]

Question 5: Write a program to calculate the volume solids viz. cuboid,cylinder


and cone can be calculated by the formula:
1. Volume of a cuboid (v = l*b*h)
2. Volume of a cylinder( v = 3.14*r*r*h)
3. Volume of cone (v = 1/3*3.14*r*r*h)
Using switch case statement . [15]

Question 6: Write a program to accept a number and display the sum of its digit.
[15]
Question 7: Write a program to input three unequal numbers and display the
second smallest number. [15]
Question 8: Write a program in java to accept length and breadth of a
rectangle.Calculate and display the area ,perimeter or diagonal of the rectangle as
per the user choice. [15]
Question 9: Write a program to input a number to check a number is Niven
number or not [15]
Question 9: Write a program to input a number to check a number is Niven
number or not

[15]
Section – C
Answer any two question
Question 10: The distance between points A(x1,y1) and B(x2,y2) is given by
the formula :
AB = √(x2 – x1)2-(y2-y1)2 [5]
WAP in java to accept the coordinate of the vertices of a triangle and check whether
it is a right angled isosceles triangle or not .The program also indicate the angle
which is a right angled Using Recursion

Question 11: Write a program to store the elements in two different matrices A
and B of order 4 X 4 .Find the products of two matrices . [5]

Question 12: write a program to input an integer number n.Find and print the
sum of all the odd numbers from 1 to n by using a recursive function. [5]
(a)

[5]
Question 5: Write a short notes on: 0 [2*5=10]

(b) Application Software


(c) Multitasking OS
(d) Shortcut
(e) Clipboard
(f) Network addressing

Section – B
[Note: Attempt any five questions from this section. ]

Question 6: Write the java expression for following statements:


 b  b 2  4ac
x
(i) 2a [1]
5
(ii) y = |abc|+ e [1]
b
(iii) z= a +ab [1]

(iv) [1]
(v) c  a b

a
|b|
[1]
(vi) a  sin 2 x  cos 2 x [1]

Question 7: Evaluate the following, where a=5, b=3;

(i) a+= (a + + % + + b) % (b + + + + + b) [2]


(ii) b* = + + a – a + + * + + b % a + + - + + a [2]
(iii) b- = ++a / b++ * ++b + a * b-- [2]

Question 8:
(a) Differentiate between implicit and explicit type data conversion with suitable
examples. [4]
(b) Name the data types sued to store the following values [2]
(i) Integers values
(ii) Real values

Question 9:

(a) Find the resultant data type of following expression: [2]


(int/float*char%double)/int
(b) Evaluate the following expression and find the value of k where a=5, b=10,
c=1; [2]
k= !(a<b) && (a<b || b>0)
(c) If p=-2 and q=-3 then calculate the value of V [2]
V= Math.pow(Math.min(p,q),Math.abs(Math.max(p,q)))

Question 10:

(a) Name any three identifier naming rules. [2]


(b) “Java is a case sensitive language”, explain the given statement. [2]
(c) Differentiate between == and = in reference of operator. [2]

Question 10: Write a program to input a four digit number and print sum of its
first and last digit. Example input: 3456, then show the output as
Sum of first and last digit is 9

Question 11: Write a program to input principal, rate and time then calculate and
print the simple interest and compound interest of input values.

You might also like