BIHANI ACADEMY
Subject: Information Technology
Java Assignments 24-25
Class XII
1. WAP in Java to enter a temperature in Celsius and
convert that into Fahrenheit.
[Hint: c/5=(f-32)/9]
2. WAP in Java to calculate Simple Interest.
[Hint: SI=(P*R*T)/100
3. WAP in Java to calculate the area and circumference of
a circle.
[Hint: A=π r 2 c=(2∗π∗r )]
4. WAP in Java to check if a given no is odd or even.
5. WAP in Java to check whether a given year is a leap
year.
6. Write a Java program that takes a number from the user
and generates an integer between 1 and 7. It displays
the weekday name.
Test Data
Input number: 3
Expected Output :
Wednesday
7. Write a Java Program to Calculate the percentage and
grade of students based on marks obtained in 5
subjects Maths, Physics, Chemistry, English, and Hindi.
Marks of the subject is taken as input:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
BIHANI ACADEMY
Percentage < 40% : Grade F
8. WAP in Java to print the following series:
1,4,9,16,25……….. N
9. WAP in Java to print the following series:
1,4,7,10,13……………….N
10. WAP in Java to print the following pattern:
22
333
4444
11. WAP in Java to print the following pattern:
1234
123
12
12. WAP in Java to check whether a given number is a
palindrome.
Test Data
Input number: 333
Expected Output: 333, Palindrome Number
Test Data
Input number: 345
Expected Output: 543, Not a Palindrome Number
13. WAP in Java to check whether a given string is a
palindrome.
BIHANI ACADEMY
Test Data
Input number: MADAM
Expected Output: MADAM, Palindrome
Test Data
Input number: AMIT
Expected Output: TIMA, Not a Palindrome
14. WAP in Java to check a given number is Armstrong
number.
Test Data
Input number: 153
Expected Output: 153, Armstrong number.
Test Data
Input number: 125
Expected Output: 134, Not an Armstrong number.
15. WAP in Java to check a given number is a Happy
number.
Test Data
Input number: 7
Expected Output: 7, Happy number.
Test Data
Input number: 4
Expected Output: Not a Happy number.