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

Grade 9 Computer Sample Paper

This document is a sample paper for Grade IX Computer Applications at VIBGYOR HIGH for the academic year 2023-24. It includes instructions for answering the paper, a variety of questions covering Java programming concepts, and programming tasks to be completed in a Java environment. The paper is structured into two sections, with Section A containing multiple-choice and short answer questions, and Section B requiring programming solutions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Grade 9 Computer Sample Paper

This document is a sample paper for Grade IX Computer Applications at VIBGYOR HIGH for the academic year 2023-24. It includes instructions for answering the paper, a variety of questions covering Java programming concepts, and programming tasks to be completed in a Java environment. The paper is structured into two sections, with Section A containing multiple-choice and short answer questions, and Section B requiring programming solutions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

VIBGYOR HIGH

2023-24
COMPUTER APPLICATIONS
SAMPLE PAPER
Grade: IX Max. Marks : 100
Date : dd/mm/yyyy Time Allowed: 2 hours

INSTRUCTIONS:

 Answers to this paper must be written on the answer paper provided


separately.
 You will not be allowed to write during the first 15 minutes.
 This time is to be spent reading the question paper.
 The time given at the head of this paper is the time allowed for writing the
answers.
 The intended marks for the questions or parts of questions are given alongside
the questions.
 Attempt all questions from Section A and any four questions from Section B.
 This question paper consists of 6 printed pages.

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) 4 bytes and 8 bytes


b) 2 bytes and 4 bytes
c) 4 bytes and 6 bytes
d) 2 bytes and 8 bytes
(v) The method of Scanner Class to accept integer value :

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

(viii) Given: double a = -8.35;


double p = Math.abs(Math.floor(a));
What will be the final value stored in the variable p?

a) -8.0
b) 9.0
c) -8.5
d) 9

(ix) Which option completes the following statement:


Employee ______ = ______ Employee () ;

a) new and emp


b) emp and new
c) new and Scanner
d) new and System.out

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

(xi) A constant which gives the exact representation of data is called

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.

(xix) The correct identifier for a method name in Java is:

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) double m = Math.max(Math.ceil(14.55),15.5); [2]


What will be the final value stored in the variable m?
(ii) What is the value of y after evaluating the expression given below? [2]
y += ++y + y- - + - -y; when int y = 8.

(iii) class public [2]


{
public static void main ()
{
int a=45.3, b=70, c=75;
tot=a+b;
System.out.println(tot)
}

Fix the code so that it compiles and runs correctly.


(iv) Give the output of the following code segments: [2]

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

Section – B (60 Marks)


Attempt any four questions from this Section. The answers in this Section should consist of
the Programs in either BlueJ environment or any program environment with Java as
the base.
Each program should be written using Variable descriptions/Mnemonics Codes so that
the logic of the program is clearly depicted. Flowcharts and Algorithms are not required.

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)
*
**
***
****
*****

*****

You might also like