🧮 Java Expression Questions
1. Convert the expression:
a + b * c - d / e into a Java expression.
2. Write the Java expression for:
Area of a circle = π × r × r
(Assume π = 3.14, and radius is r)
3. Write a Java expression for converting temperature from Celsius to Fahrenheit:
F = (9/5) * C + 32
4. Convert this expression to Java:
Simple Interest = (P × R × T) / 100
5. Convert the mathematical expression:
Speed = Distance ÷ Time
to a Java expression.
6. Write a Java expression to calculate the perimeter of a rectangle:
Perimeter = 2 × (Length + Breadth)
7. Evaluate this Java expression:
int result = 4 + 5 * 2 - 8 / 4;
What is the value of result?
8. Write a Java expression to calculate compound interest:
A = P × (1 + R/100) ^ T
(Hint: use Math.pow() for exponent)
9. Given x = 5, y = 3, evaluate the expression:
x++ + --y * 2
10. Convert the following into a Java expression:
Volume of Sphere = (4/3) × π × r³
11. Given int a = 10, b = 5;
Write a Java expression to find the average of a and b.
12. Convert the Boolean condition into a Java expression:
Is number divisible by 3 and 5?
13. Write a Java expression to check if a number is even.
14. Simplify this expression using Java operators:
x = x + 5 into a short-hand assignment operator.
15. Write a Java expression for:
Check if a number is between 10 and 50 (inclusive).