Grade 9 Computer Sample Paper
Grade 9 Computer Sample Paper
2023-24
COMPUTER APPLICATIONS
SAMPLE PAPER
Grade: IX Max. Marks : 100
Date : dd/mm/yyyy Time Allowed: 2 hours
INSTRUCTIONS:
Question 1 Choose the correct answer and write the correct option. [20]
(i) Name the feature of java depicted in the above picture.
a) Abstraction
b) Encapsulation
c) Polymorphism
d) Inheritance
(ii) The expression which uses && operator is known as:
a) Arithmetic
b) Logical
c) Relational
d) Assignment
(iii) Among the following which is a keyword?
a) Instance
b) switch
c) Class
d) For
1
(iv) Name the size in bytes of the following data types.
i.int
ii.long
a) nextInteger()
b) Nextint()
c) nextInt()
d) NextInt()
(vi) Given: String st = (a>= 90)? "Excellent": "Best";
Predict the output, when a = 90.
a) Best
b) Excellent: Best
c) Best: Excellent
d) Excellent
(vii) Among the following, which is not an OOP’S concept?
a) Encapsulation
b) Exception
c) Abstraction
d) Polymorphism
a) -8.0
b) 9.0
c) -8.5
d) 9
2
(x)
Which of the following is false to find square of a number?
a) Math.pow(a,2)
b) a*a
c) Math.sqrt(a,2)
d) All of the above
a)Variable
b)Literal
c)Identifier
d)Character
(xii) A character literal is enclosed in:
a) ' '
b) " "
c) : :
d) { }
(xiii) Which of the following type is an exact representation of fractional
values?
a)char
b)double
c) byte
d)String
(xiv) The statement n += 4 is equivalent to:
a)++n
b)n=n+4
c)n+1
d)none
(xv) What will be the output of a & b in the following, if int a, b; a=10; b=a++;
a)10,10
b)10,11
c)11,10
d)11,11
(xvi) If int a = 25, b = 5, c = 0; what value is stored in c? When c = a % b;
a)5.0
b)5
c)0
d)none
(xvii) When the statements are repeated sequentially a number of times in a
program, the construct is known as:
a)iteration
3
b)sequence
c)selection
d)none
(xviii) Assertion (A) : In Java, more than one method can be created with
same name.
Reason (R) : Polymorphism describes the ability of something to
have or to be displayed in more than one form, so methods can be
overloaded.
a)Both Assertion (A) and Reason (R) are true and Reason (R) is a correct
explanation of Assertion (A).
b)Both Assertion (A) and Reason (R) are true and Reason (R) is not a
correct explanation of Assertion(A).
c)Assertion (A) is true and Reason (R) is false.
d)Assertion (A) is false and Reason (R) is true.
a)class
b)Class1
c)Class_&
d)1classname
(xx) To execute a loop 10 times, which of the following statement satisfies:
a)for(i=6;i<=26;i=i+2)
b)for(i=3;i<=30;i=i+3)
c)for(i=0;i<10;i=i++)
d)all of the above
Question 2 [20]
i. Math.ceil(-12.56)
ii. Math.floor(- 126.349)
4
(v) Write any two jump statements used in Java. [2]
(vi) Define the term JVM. [2]
(vii) Differentiate between break and System.exit(0). [2]
(viii) If a=5, b=9, calculate the value of a [2]
a += a++ - ++b +a;
(ix) Rewrite the following code fragment using for loop: [2]
int i = 100;
while (i > 0)
{System.out.println (i);
i -= 3;
}
(x) Explain: [2]
i) Intellectual Property (IP)
ii) Patent
Question 4 [15]
Using a switch statement, write a menu driven program to convert a given Kilometre
to Metre and vice versa. For an incorrect choice, an appropriate error message
should be displayed
Question 5 [15]
Write a program to input a 3-digit number and check whether it is Armstrong
number or not. Numbers whose sum of the cube of its digit is equal to the number
itself are called Armstrong numbers.
Example 153=13+53 +33
5
Question 6 [15]
A cloth showroom has announced the following festival discounts on the purchase of
items, based on the total cost of the items purchased:
Total cost Discount(in
Percentage)
Less than 1000 5%
1001 to 2500 25%
2501 to 5000 35%
Above 5000 50%
Write a program to input the total cost and compute and display the amount to be
paid by the customer after availing the discount.
Question 7.
Write a menu driven program to input a month number between 1 to 7 and print the
corresponding colour name. That is for 1 display Violet, for 2 display Indigo, for 3 [15]
display Blue etc, and display invalid choice wherever needed.
Question 8. [15]
Write a program to check whether a number is prime or not.
Question 9. [15]
Write java programs to generate the following patterns.
i) 1
2 3
4 5 6
7 8 9 10
ii)
*
**
***
****
*****
*****