0% found this document useful (0 votes)
16 views8 pages

Annual Examination Updated

This document outlines the structure and content of an annual computer exam for 9th-grade students, including various types of questions such as fill-in-the-blanks, multiple choice, true/false, and short answer questions. It covers topics related to Java programming, including concepts like constructors, data types, and method overloading. Additionally, it includes long answer questions that require students to write programs and define classes based on given specifications.

Uploaded by

jharana das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views8 pages

Annual Examination Updated

This document outlines the structure and content of an annual computer exam for 9th-grade students, including various types of questions such as fill-in-the-blanks, multiple choice, true/false, and short answer questions. It covers topics related to Java programming, including concepts like constructors, data types, and method overloading. Additionally, it includes long answer questions that require students to write programs and define classes based on given specifications.

Uploaded by

jharana das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CLASS: 9TH TALENT SPRINT CLASSES DATE: 09.02.

2026
TIME: 2 H.R. COMPUTER FULL MARK: 90
ANNUAL EXAM
1. Fill in the blanks: [1 X 5 = 05]
a. The _______ and _______ are terminated using break statements.
b. The _______ is used to declare a function which does not return any value.
c. The invoking of a constructor can be done by _______ keyword.
d. The _______ method is used to convert string data to float type.
e. _______is the default package in java.
2. Multiple choice questions: [1 X 10 = 10]
a. The conversion of a primitive value into an object of the corresponding wrapper
class is called ________.
i. Auto boxing ii. Un boxing iii. Type casting iv. All of these
b. If S = “123” which among the following will convert it to an integer?
i. int a = Integer (s); ii. int a = (int)s; iii. int a = parseInt (s);
iv. int a = Integer. parseInt (s);
c. The parameter used in method call statement is known as
i. defined parameter ii. actual parameter iii. formal parameter iv. passed parameter
d. The exit statement in the inner loop will terminate the _______.
i. Inner loop only ii. Outer loop only iii. Both the loops iv. None of these
e. Which of the following type can be used for a non-returnable method?
i. int ii. float iii. double iv. void
f. The default value of int data type when default constructor is called is
i. 1 ii. 0 iii. 3 iv. 2
g. What is the purpose of a constructor in a java class?
i. To declare variable ii. To initialize objects of the class iii. To define methods
iv. To create interfaces
Page 1 of 8
h) The process of calling a method in such a way that the change in the formal
arguments reflects on the actual parameter is known as.
i. call by reference ii. call by value iii. call by method iv. None
i) Which of the following functions checks whether a character is a blank or not?
i. Character. isBlankSpace ( ) ii. Character. isWhite Space ( )
iii. Character. isEmptySpace ( ) iv. Character. isNull ( )
j) The variable must be declared ______ type if a character is to be assigned to it.
i. char ii. ch iii. character iv. alpha
3. State Weather the following statements are True/False: [1 X 5 = 05]
a. Array is a non-primitive data type.
b. A constructor is defined with return type.
c. isUpper Case ( ) method converts a string to uppercase.
d. A constructor is a member methods a class.
e. isLetter OrDigit (char) is the method to check whether a character is a letter or digit.
4. Find out the output of the following questions: [2 X 5 = 10]
a. int j, k, p = -1;
for (j = -2; j<=1;j + +)
{
for (k = j; k < = 0; k + +)
k= [Link] (j * k, p);
[Link] (k);
p = p + 2;
}
i. How many times will the outer loop run?
ii. Predict the output.

Page 2 of 8
b. String S1 = “45.50”;
String S2 = “54.50”;
double d1 = [Link] (S1);
double d2 = [Link] (S2);
int x = (int) (d1 + d2);
What is the value of x?
c. char ch = ‘x’;
int n = 5;
n=n+(int) ch;
char c = (char)n;
[Link] ((char) ((int) c – 26));
d. Fill in the blanks to design a class.
Class _________
{
int l, b;
Area (int ______, int _______)
{
l= ________,
b = ________,
}
e. Differentiate between the following statements.
abc p = new abc( );
abc p = new abc (7, 5, 9);

Page 3 of 8
SECTION – B [SUBJECTIVE]
5. Very short answer type: [1 X 10 = 10]
a. When a method is invoked how many values can be returned from the method?
b. Which OOP principal implements method overloading?
c. What is the role of the keyword “void” in declaring methods?
d. What action will you take to terminate an outer loop form the block of an inner
loop?
e. What is the name of the parameters which receive the values from the called
method?
f. Which keyword is used to access the classes of a package to a program?
g. A method which does not modify the value of variables is termed as _______.
h. Method which is a part of a class rather than an instance of the class is termed as
_________.
i. Write the prototype of a function check which takes an integer as an argument and
returns a character.
j. The programming structure that repeats a block of code multiple times until a
specific condition is meet is known as:-
6. Short answer type questions: [2 X 10 = 20]
a) State the difference between call by value and call by reference.
b) What is a default constructor? Explain with the help of an example.
c) What are two rules to define a constructor?
d) Differentiate between primitive data type and composite data type.
e) Answer as directed:
i. Assign an string “123” to a String Variable ‘a’.
ii. Convert the variable ‘a’ to an integer and store it in the variable ‘S’.
f) Differentiate between autoboxing and unboxing.
g) What is wrapper class? Give two examples of parsing methods in wrapper class.

Page 4 of 8
h) State the method that:
i. Converts a string to a primitive float data type.
ii. Determines, if the specified character is an upper case character.
i) Differentiate between
i. isUpperCase ( ) and toUpperCase ( )
ii. parseInt( ) and to String ( ) functions.
j) What is a package? What is the significance of ‘*’ while importing a package?
7. Long answer type questions: [5 X 6 = 30]
a. Write a menu driven program to generate the upper case letters from Z to A and
lowercase letters form a to z as per the user’s choice.
Enter 1 to display uppercase letters from Z to A and Enter 2 to display lowercase
letters from a to z.
b. Write a java program to print the following pattern.
i. * ii. A
*# A B
*#* A B C
*#*# A B C D
*#*#* A B C D E
c. Rahul was asked to create class with methods to calculate the area of a triangle
(1/2*b*h), the area of a square (s * s), the area of a trapezium (1/2*h*(a + b)), the area
of a rectangle (l*b). He created a class by giving the same name to all the methods as
“Area”. Define a class with the four methods with the same name.
d. Define a class named Movie Magic with the following description:-
Class name: Movie Magic
Instance Variable:
int year: To store the year of release of the movie.
String title: To store the title of the movie.

Page 5 of 8
float rating: To store the popularity rating of the movie.
(Minimum rating = 0.0
Maximum rating = 5.0)
Member Methods:-
i. Movie Magic ( ) :- defined constructor to initialize numeric data member to 0 and
string data members to “ ”.
ii. void accept ( ): To input and store year, title and rating.
iii. void display ( ): To display title of the movie and message based on the rating as
per the table given below.

Rating Message to be displayed


0.0 to 2.0 Flop
2.1 to 3.4 Semi-Hit
3.5 to 4.5 Hit
4.6 to 5.0 Super Hit
Write the main method to create an object of the class and call the above member
methods.
e. Write a program to input a number and check and print whether it is a ‘pronic’
number or not. Use the method as , int pronic (int n) to accept a number and the
method returns 1, if the number is pronic, otherwise returns zero.
e.g. Pronic number is the number which is the product of two consecutive integers.
12 = 3*4
20 = 4*5
42 = 6*7
f. Define a class Bill that calculates the telephone bill of a consumer with the following
description:
Instance Variables/Data Members:
int bno: bill number

Page 6 of 8
String name: name of Consumer
int call: no. of calls consumed in a month.
double amt: bill amount to be paid by the person.
Member methods:
Bill ( ) : Constructor to initialize data members with default initial value.
Bill ( ): Parameterized constructor to accept bill no, name and no. of calls consumed.
Calculate ( ):- To calculate the monthly telephone bill for a consumer as per the
following conditions.

Units consumed Rate


First 100 calls Rs. 0.60/call
Next 100 calls Rs. 0.80/call
Next 100 calls Rs. 1.20/call
Above 300 calls Rs. 1.50/call

Fixed monthly rental applicable to all consumers is Rs. 125.


Display ( ): To display the details.
Create an object in the main ( ) method and invoke the above functions to performs
the desired task.
ALL THE BEST

Page 7 of 8
Page 8 of 8

You might also like