0% found this document useful (0 votes)
23 views6 pages

Grade 9 Computer Applications Exam 2025

The document is an examination paper for Grade 9 Computer Applications at Carmel School, Bengaluru, for the academic year 2025-26. It includes multiple-choice questions, short answer questions, and programming tasks related to Java concepts and syntax. The paper is divided into two sections, with a total of 100 marks allocated for various questions covering topics such as data types, object-oriented programming principles, and basic Java programming.

Uploaded by

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

Grade 9 Computer Applications Exam 2025

The document is an examination paper for Grade 9 Computer Applications at Carmel School, Bengaluru, for the academic year 2025-26. It includes multiple-choice questions, short answer questions, and programming tasks related to Java concepts and syntax. The paper is divided into two sections, with a total of 100 marks allocated for various questions covering topics such as data types, object-oriented programming principles, and basic Java programming.

Uploaded by

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

CARMEL SCHOOL

Padmanabhanagar, Bengaluru - 70
FIRST TERMINAL EXAMINATION 2025 - 26
Grade: 9
SUBJECT: COMPUTER APPLICATIONS(Key answer)
Time: 2hours Max. Marks: 100
Answers to this paper must be written on the paper provided [Link] will not be allowed to
write during the first 15 [Link] time is to be spent reading the question paper.
The time given at the head of this paper is inclusive of reading time. The intended marks for
questions or parts of questions are given in brackets [ ].
Section-A(40 marks)(Attempt all questions)
Question 1
I. Choose the correct answer to the questions from the given options: [10]
(Do not copy the question, write the correct answer only)
1) _________ is created after the compilation of java source code.
a) object code b) machine code
c) byte code d) Executable file
2) The numeric data type that requires the least memory size is _______.
a) int b) short c) byte d) double
3) Which of the following would compile without error?
a) int a = [Link](-5); c) int b = [Link](5.0);
b) int d = [Link](5.5-7.5); d) int c = [Link](5.5F);
4) Give the output for the following:-
int a=20,b=4,c=4,d;
d=a+b%c;
[Link](d+c+ "is the output");
a) 23is the output b) 24is the output
c) 27is the output d) dcis the output
5) Which among the following is not a logical operator?
a) && b) || c) ! d) <=
6) Which statement is true about Java concatenation?
a) + is only used for addition
b) + acts as concatenation operator if at least one operand is a String
c) + between char and int always produces a String
d) Parenthesis do not affect concatenation
7) The output of [Link]("Hi" + (2 + 3) + (4 + 5)); is
a) Hi2345 b) Hi14 c) Hi59 d) Hi23+45
8) Give the output of the following:-
char ch = 'A' ; int k = 1;
[Link]("Value = " +(ch+k) );
a) Value = A1 b) Value = 66 c) Value = B d) Error
9) ________ refers to the reserved words that has special meaning to the java compiler.
a) identifier b) keyword c) main d) comments
10) Assertion (A): Java is centered around the concepts of objects, which represent
real-world entities and encapsulate both data and behaviour.
Reason (R): Java is an Object-Oriented Programming Language.
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
Question 2
I Name the OOP principle depicted in the following:- [4 x 1 = 4]
a) You can borrow books by scanning your library card, but the database that keeps track
of all books and borrowers is hidden and protected. Encapsulation
b) The word “play” can refer to playing a musical instrument, playing a sport, or playing
a video game. Polymorphism
c) Using the camera app on the smartphone, you just tap the screen to take a photo,
without needing to understand how the lens and sensor work internally. Abstraction
d) A locker in a gym can only be opened with a key or code. Encapsulation
II Give the full form of the following:- [2 x 1 = 2]
a) jdk java development kit b) JVM java virtual machine
III Give the memory space for the following(in bits) :- [2 x 1 = 2]
a) \t 16 b) 23.5 64
IV Give the default value of the following data types:- [2 x 1 = 2]
a) char ‘\u0000’ b) boolean false
Question 3
I State if the following is a valid or invalid identifier. If invalid, state
the reason:- [3 x 1 = 3]
a) _sum1 valid b) 5star invalid c) Int valid
II Write a java statement for the following:- [2 x 1 = 2]
a) To increase the value of the variable, x by 100 using shorthand operator.
x+=100;
b) To declare 3 float variables A, B and C.
float A, B, C;
III Give the output for the following code snippets:- [1+1+1+2]
a) [Link]([Link](12.0, 38/3)); ➔12.0
b) int x = 5, y = 12;
[Link](x%y > y%x); ➔ true
c) [Link]([Link](125)); ➔ 5.0
d) [Link]("Repeater\n\n");
[Link]("Router\n\n");
[Link]("Hub");
Repeater
_______
Router
_______
_______
Hub
Question 4
I Which data type will be most appropriate to store the following:- [3 x 1 = 3]
a) Number of days in a week byte
b) Population of a city long
c) First letter of your school char
II Write java expression for the following:- [2 x 2 = 4]
3 3
√𝑎 − √𝑏
a) M= M = ([Link](a)-[Link](b))/(a+b);
𝑎+𝑏
2𝑎𝑏 +3𝑏 𝑎
b) K = K = (2*[Link](a,b)+3*[Link](b,a))/(5+[Link](a));
5+√𝑎
III Evaluate the following expression and write the output:-
a) int a = 4, b = 6; [3]
a-= ++a – b++ *3;
[Link](a - b);
[Link](++a);
10
18
Section-B(60 marks)(Attempt all questions)Part I
Question 5
1) Write a short note on primitive data types in java. [2]
Primitive data types are the fundamental data types predefined by the language.
There are eight primitive data types supported by Java. They are byte, short,int,
float, double, char and boolean
2) Write any two limitations of using procedural language. [2]

3) Write the resulting data type of the following: - [2]


a) Mathematical expression with operands of int, long and double. double
b) Relational expression. boolean
4) Explain type casting with an example. [2]
Explicit conversion done by the user using ( ) operator to convert from higher data
type to lower data type and vice versa.
Example:
int x=10; double y=10.55;
int z=(int)(x+y);
5) Define the following:- [3]
a) class

b) encapsulation
6) Give the difference between unary operator and binary operator with 2
examples each. [3]
unary operator ➔ Requires one operand to perform [Link]:- ++, --, unary +,etc.
binary operator ➔ Requires two operands to perform [Link]:- +, -, /,*,etc.

7) Name the package in which Math class is defined. [1]


[Link]
Question 6
1) Rewrite the expression by filling the blanks with the appropriate operators to
get 13 as the value stored in the variable, c:- [2]
int a=7, b=3, c;
c=a __ b __ 2;
c=a+b*2;
2) Write a short note on escape sequence characters in java. [2]
In Java, an escape sequence is a special combination of characters used to represent
certain non-graphic characters that are difficult to type directly. These sequences always
begin with a backslash (`\`) followed by another character. Its data type is char
occupying 2 bytes.
3) Rewrite the jumbled java statements in the correct sequence to convert Km to m
and cm:- [5]
[Link]("Metres = "+m);
m=km*1000;
[Link]("Centimetres = "+cm);
int km=2, m, cm;
cm = m*100;
int km=2, m, cm; int km=2, m, cm;
m=km*1000; m=km*1000;
cm = m*100; [Link]("Metres = "+m);
[Link]("Metres = "+m); cm = m*100;
[Link]("Centimetres = "+cm); [Link]("Centimetres = "+cm);
4) Write 2 attributes and 2 behaviours of the following objects:- [4]
a) Cricket Ball b) Electric Kettle
5) Debug the following:- [2]
a) int m = 45.66f; ➔int m = 45; OR float m=45.66f;
b) char ch = "\\"; ➔ char ch = ‘\\’; OR String ch = "\\";
Part II
(Write variable description for all the programs)
Question 7
1) A cab driver earns ₹15 per km travelled. Write a program to accept the total
distance travelled in a day by him to display his net earnings. [7]

import [Link].*;
class taxi
{
public static void main()
{
Scanner sc=new Scanner([Link]);
[Link]("Enter the distance");
double dist = [Link]();
double amt = dist*15;
[Link]("The net earnings of the cab driver is "+amt);
}
}
2) A cinema hall charges ₹150 per person. An additional entertainment tax of 18% is
added on the total amount. Write a program to accept the number of customers and
calculate the total collection with tax. [8]
import [Link].*;
class cinemaHall
{
public static void main()
{
Scanner sc=new Scanner([Link]);
[Link]("Enter the number of customers");
int n = [Link]();
double amt = n*150;
double net = amt + 0.18*amt;
[Link]("The total collection is "+net);
}
}
Question 8
1) Write a program to accept the mass of the object(m) and velocity of the object(v)
to calculate the kinetic energy using the formula: [7]

import [Link].*;
class Kinetic
{
public static void main()
{
Scanner sc=new Scanner([Link]);
[Link]("Enter the mass and volume”);
double m=[Link]();
double v = [Link]();
double KE = 05 * m* v*v;
[Link]("Kinetic energy is “+KE);
}
}
2) A student earns 10 marks for each correct answer and loses 5 marks for each wrong
answer in a quiz. Write a program to accept the number of correct answers out of 40
questions to calculate the score of the student. [8]
import [Link].*;
class Quiz
{
public static void main()
{
Scanner sc=new Scanner([Link]);
[Link]("Enter the number of current answers”);
int correct = [Link]();
int wrong = 40 – correct;
int total = 10*correct – 5*wrong;
[Link]("The Score is “+total);
}
}

Common questions

Powered by AI

Logical operators in Java, such as AND (&&), OR (||), and NOT (!), are used to build complex conditional statements by combining multiple relational expressions. They allow for the creation of nuanced logic that can evaluate multiple conditions simultaneously, crucial for decision structures and flow control in applications, optimizing the evaluation process by short-circuiting unnecessary operations .

The Java Virtual Machine (JVM) plays a critical role in executing Java programs by running byte code on any platform with a compatible JVM. This execution model abstracts the underlying operating system, allowing Java’s 'write once, run anywhere' mantra, enhancing cross-platform capabilities, enabling Java's extensive use in diverse environments .

Encapsulation and abstraction differ in that encapsulation is about restricting access to object components and bundling data and methods, while abstraction is about hiding complex implementation details from the user. They complement each other by ensuring that an object can offer well-defined interfaces (abstraction) while protecting internal states through controlled access (encapsulation), leading to more robust and manageable code .

Relational expressions evaluate to boolean in Java because they are used to compare operands, resulting in true or false values. This evaluation is significant for programming logic, as it underpins decision-making structures like if-else statements, loops, and conditions, thereby controlling the flow of the program based on specific criteria .

Byte code is created after the compilation of Java source code and is executed by the Java Virtual Machine (JVM). It is central to Java's portability as it allows Java programs to be run on any platform with a compatible JVM, meaning the same code can be executed across various operating systems without modification .

Encapsulation is an OOP principle where data and the code that manipulates it are kept together, protecting it from outside interference. In real-world applications, encapsulation is seen in systems such as library databases, where user interactions can borrow items without accessing the database directly. Similarly, in gym lockers, access is mediated by a key or code, shielding the contents from unauthorized access .

Mathematical operations in Java result in specific data types based on the operands involved. An operation with int, long, and double results in a double type due to automatic type promotion, which ensures precision in floating-point arithmetic. This behavior implies that programmers must be aware of potential precision issues and the need for explicit type casting when precision is crucial .

Escape sequence characters in Java allow for the representation of non-graphic or special characters in strings, such as newlines or tabs, which are otherwise difficult to input. They enhance string handling by allowing for the formatting of output and the inclusion of control characters, which is necessary for creating user-friendly interfaces and managing layout in text output .

Type casting in Java is used to convert a value from one data type to another, either automatically or explicitly. It allows for flexibility in operations, enabling the use of consistent data types and resource optimization. However, pitfalls include the risk of information loss during conversion, particularly when casting from a higher-precision type like double to a lower-precision type like int, requiring careful planning to avoid errors .

Primitive data types in Java offer benefits like efficient memory use and faster performance due to their fixed sizes and direct storage in memory. However, challenges include limited functionality compared to objects, as they lack methods, and the potential need for type casting when interacting with non-primitive data types, which can lead to complexity if not managed properly .

You might also like