Java questions in the Class 9 Computer Applications Mid-Term exam can test more than just definitions. You may need to identify the correct operator, understand how conditions work, distinguish between similar symbols such as / and %, and apply logic while writing or reading a program.
The PW ICSE Class 9 Computer Applications Mid-Term Marathon focuses on these important areas through question-based revision. You can revise Java decision-making, relational and logical operators, compound statements, mathematical functions and common programming conditions such as checking whether a number is even or odd.
The marathon brings together several Java concepts that are useful for solving basic programming questions and understanding how conditions work in a program.
Java Basics and Mathematical Operations |
|
|---|---|
|
Topic |
What You Need to Revise |
|
Heron's Formula |
Semi-perimeter formula: s=a+b+c2s = \frac{a+b+c}{2}, where aa, bb and cc represent the three sides of a triangle |
|
Square Root |
The Math.sqrt() method is used to calculate the square root of a number |
|
Division Operator |
/ gives the quotient after division |
|
Modulus Operator |
% gives the remainder after division |
|
Operands |
Values or variables on which an operator acts |
Decision-Making and Conditions |
|
|---|---|
|
Topic |
What You Need to Revise |
|
if-else |
Used to make decisions based on whether a condition is true or false |
|
Voting Eligibility |
A person is eligible to vote when Age >= 18 |
|
Relational Operators |
<, >, <=, >=, == and != |
|
Compound Statements |
Multiple executable statements grouped inside { } |
|
Single-Statement if Block |
Curly braces can be omitted when an if condition controls only one statement |
Logical Operators and Program Conditions |
|
|---|---|
|
Topic |
What You Need to Revise |
|
Logical AND && |
Gives true only when all the connected conditions are true |
|
Logical OR ` |
|
|
Even or Odd |
num % 2 == 0 checks whether a number is even |
|
Comparing Three Numbers |
Conditions such as (a > b && a > c) can identify whether a is greater than both other numbers |
|
Equal Numbers |
If no number is strictly greater than the others, all three numbers are equal |
Practising direct concept questions along with small programming conditions can help you become more comfortable with Java syntax and logic. Here are the important questions covered in the PW Mid-Term Marathon.
Q1. What is the formula for the semi-perimeter (ss) used in Heron's Formula for calculating the area of a triangle?
Answer:
s=a+b+c2s = \frac{a+b+c}{2}
Here, aa, bb and cc are the lengths of the three sides of the triangle.
Q2. Which Java method is used to calculate the square root of a number?
Answer: Math.sqrt()
The Math.sqrt() method returns the square root of a given number.
Q3. Which statement structure is used for decision-making in Java programming?
Answer: if-else conditional statements.
An if-else statement allows a program to choose between different actions depending on whether a condition is true or false.
Q4. What is the mathematical condition to check if a person is eligible to vote based on age?
Answer:
Age≥18\text{Age} \geq 18
In Java, this condition can be used to check whether the person's age is 18 or above.
Q5. What is the primary function of a relational operator?
Answer: Relational operators compare two values or variables and return a Boolean result, either true or false.
Q6. What are the common relational operators used in programming?
Answer:
<, >, <=, >=, == and !=
These operators are commonly used when creating conditions in Java programs.
Q7. What is an operand in an expression?
Answer: An operand is a value or variable on which an operator acts.
For example, in a + b, a and b are operands, while + is the operator.
Q8. How do you programmatically check whether an integer is even or odd?
Answer: Use the modulus operator.
num % 2 == 0
If the remainder is 0, the number is even. Otherwise, the number is odd.
Q9. What is the difference between the / and % operators in Java?
Answer:
/ returns the quotient.
% returns the remainder.
For example, when 10 is divided by 3, 10 / 3 gives the quotient, while 10 % 3 gives the remainder.
Q10. What is a compound statement in Java?
Answer: A compound statement is a group of multiple executable statements enclosed within curly braces { }.
It allows several statements to be treated as a single block.
Q11. Why are curly braces { } optional for an if block containing only a single statement?
Answer: By default, an if condition controls the immediate next statement. Therefore, curly braces are not necessary when there is only one statement inside the block.
Q12. When does a Logical AND (&&) operator return true?
Answer: The && operator returns true only when all the connected conditions are true.
Q13. When does a Logical OR (||) operator return true?
Answer: The || operator returns true when at least one of the connected conditions is true.
Q14. What combined condition checks if variable a is greater than both b and c?
Answer:
(a > b && a > c)
The && operator ensures that both comparisons must be true.
Q15. In a three-number comparison program, what does it mean if none of the numbers are strictly greater than the others?
Answer: It means that all three numbers are equal.
a=b=ca = b = c
When all three values are the same, none of them is strictly greater than another.
Note: For More Deatiled Solutions and More Questions Perfer the video
Java becomes easier to practise when you focus on how each concept works rather than trying to memorise isolated definitions. The PW Mid-Term Marathon can help you revise important programming ideas through questions and explanations.
Revise Java fundamentals: Refresh concepts such as operands, mathematical methods and basic statements.
Understand operators: Differentiate between relational, arithmetic and logical operators.
Practise conditions: Work with conditions used for voting eligibility, even-odd checks and number comparisons.
Strengthen program logic: Understand how if-else, && and || affect the flow of a program.
Clear syntax-related doubts: Review the use of curly braces and compound statements.
Prepare with important questions: Practise questions based on the concepts covered in the marathon.
Good performance in Computer Applications depends on understanding what each Java statement and operator does and knowing how to apply it in a program. Use the Mid-Term revision time to practise conditions, operators and basic Java logic instead of only reading definitions. Revising these concepts with important questions can help you approach programming-based questions with greater clarity.