0% found this document useful (0 votes)
5 views3 pages

Java Assignment Questions-1

The document contains a list of 48 Java assignment questions that cover various programming concepts such as temperature conversion, area calculation, number manipulation, data structures, and object-oriented programming. Each question requires the implementation of specific Java programs to demonstrate understanding and application of Java programming skills. Topics include loops, conditionals, classes, inheritance, and recursion.

Uploaded by

Manvinder Singh
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)
5 views3 pages

Java Assignment Questions-1

The document contains a list of 48 Java assignment questions that cover various programming concepts such as temperature conversion, area calculation, number manipulation, data structures, and object-oriented programming. Each question requires the implementation of specific Java programs to demonstrate understanding and application of Java programming skills. Topics include loops, conditionals, classes, inheritance, and recursion.

Uploaded by

Manvinder Singh
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
You are on page 1/ 3

JAVA ASSIGNMENT QUESTIONS

1. Write a program in Java to change the temperature Celsius to Fahrenheit.

2. Write a program in Java to calculate the area of a circle and its circumference.

3. Write a program in Java to check whether a number is even or odd.

4. Write a program in Java to swap two numbers using a third variable.

5. Write a program in Java to swap two numbers without using a third variable.

6. Write a program in Java to find the greatest of three numbers.

7. Write a program in Java to check if a year is a leap year or not.

8. Write a program in Java to check if a year is a leap year or not using nested if.

9. Write a program in Java to check if a number is divisible by 7 within 0 to 100.

10. Write a program in Java to find the roots of a quadratic equation.

11. Write a Java program to calculate factorial of 12.

12. Write a Java program for Fibonacci series.

13. Write a Java program to reverse a number.

14. Write a Java program to calculate the sum of natural numbers up to a certain range.

15. Write a Java program to find HCF of two numbers.

16. Write a Java program to find LCM of two numbers.

17. Write a Java program to calculate the exponential of a number.

18. Write a Java program to check whether a number is palindrome or not.

19. Write a Java program to check whether a number is prime or not.

20. Write a Java program to convert a Binary Number to Decimal and Decimal to Binary.

21. Write a Java program to compute the value of Euler’s number that is used as the base of
natural logarithms. Use the following formula:
e = 1 + 1/1! + 1/2! + 1/3! + ... + 1/n!
22. Write a Java program to generate all combinations of 1, 2 or 3 using loop.

23. Write a Java program to display prime numbers between a given interval.

24. Write a Java program to check whether a given number is Armstrong number or not.

25. Write a Java program to calculate the sum and average of an integer array.

26. Write a Java program to implement a stack using an array.

27. Write a Java program to implement a queue using an array.

28. Write a Java program to search for an element in an array.

29. Write a Java program to find the sum of diagonal elements in a 2D array.

30. Write a Java program to reverse the elements of an array of integers using a second array.

31. Write a Java program to find the sum of all odd numbers in a 2D array.

32. Write a Java program to find the second highest element of an array.

33. Write a Java program to find duplicate elements in a 1D array and find their frequency of
occurrence.

34. Create a class Box and describe all the constructors of the class. Include a volume()
method that will return the volume of the box object. (Overloading Constructor)

35. Create an Element class with age and sal using constructor, take input and find the highest
salaried employee.

36. Create a class Complex and add two complex objects using the this keyword.

37. Create a class Time with three private instance variables — hour, min, and sec. It contains
a method add() which takes one Time object as parameter, adds the values of the calling
and passed Time object and displays the result. In the main method, declare two Time
objects, assign values using the constructor and call the add() method.

38. Write a program to define a class having one 3-digit number (num) as a data member.
Initialize and display the reverse of that number.

39. Write a program to define a class Student with four data members such as name, roll_no,
sub1, and sub2. Define appropriate methods to initialize and display the values of data
members. Also, calculate total marks and percentage scored by the student.

40. Describe the static keyword using a proper example.


41. Use a class BankAccount that contains A/C holder name, amount deposited, amount
withdrawn, balance. Create a static variable to count the total number of accounts created.
getcount() function should display the total count (this function should be static too).

42. Create a variable size stack (size is user input).

43. Create a class Factorial and its method to find the factorial of a given number using
recursion.

44. Implement Single Inheritance.

45. Implement Multilevel Inheritance by Java.

46. Create a class Figure and extend Rectangle, Triangle, and Cylinder from it in Java
Programming.

47. Override the method showArea in the base class to display the corresponding area of the
relevant figures in Java programming.

48. Create a class Number, extend Binary, Octal, and Hexadecimal classes from Number in
Java.

You might also like