14,21 errors
13,15, graphics
[Link] to print first five even-odd numbers. And also print the total sum of all numbers.
1. WAP to check a given number is prime. Input takes from User.
2. WAP to check the given number is divisible by 5.
3. WAP to check the given year is leap year or not.
4. WAP that reads a student's marks (out of 100) as input and prints their grade based on the
following criteria:
If the marks are 90 or above, print "Grade A"
If the marks are 80 or above but less than 90, print "Grade B"
If the marks are 70 or above but less than 80, print "Grade C"
If the marks are less than 70, print "Grade D"
5. Simple Calculator using Switch Case.
6. WAP using a switch statement to implement a simple Currency Converter from INR to USD,
EUR, or JPY.(1INR = 0.012USD =0.011EUR =1.76JPY)
7. WAP where the computer has a secret number (e.g., 47). The user must keep guessing the
number until they guess it correctly. After each guess, the program should give a hint:
a. If the guessed number is less than the secret number, print “ Too low! Try again”.
b. If the guessed number is greater than the secret number, print “Too high! Try again”.
c. If the guess is correct, print “Correct! You guessed the number”, and exit while loop.
Requirements:
d. Use a while loop to repeat guessing.
e. Use the Scanner class for input
f. Use [Link]() to generate one random number(1-100).
import [Link];
8. WAP to print numbers in reverse from 100 to 1.(using for loop)
9. WAP to print Fibonacci series using for loop.
10. WAP to find the first number divisible by 3 and 5.
11. WAP that reads a string from the user and prints the string after removing all vowels. To skip
vowels using continue statement.
12. Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons
for the digits and for the +, -,*, % operations. Add a text field to display the result. Handle any
possible exceptions like divided by zero.
13. WAP to calculate area and Perimeter of a Circle with the help of class and object
(Area=Pi*R*R, Perimeter = 2*Pi*R).
14. Value and returns it in another text field, when the button named “Compute” is clicked.
15. Write a Java program that creates a user interface to perform integer divisions. The user
enters two numbers in the text fields, Num1 and Num2. The division of Num1 and Num 2 is
displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an
integer, the program would throw a Number Format Exception. If Num2 were Zero, the
program would throw an Arithmetic Exception. Display the exception in a message dialog
box.
16. Write a Program to Print Pyramid Number Pattern in Java.
*
***
*****
*******
17. Write a Java Program to Print Pattern.
1
212
32123
4321234
543212345
65432123456
18. WAP Java program to convert a number binary to octal using user-defined function.
19. Write a program to create a two-player Tic-Tac-Toe game using a 3X3 board.
The game should allow players X and O to take turns.
Players must enter the row and column (0–2) to place their mark.
The program should check after each move if a player has won (3 in a row, column, or
diagonal).
If the board is full and no one wins, the game should display "It's a draw!".
20. WAP to Add two Complex Numbers.
21. WAP to swap the two values without using third variable.