[Go to site: main page, start]

0% found this document useful (0 votes)
2 views2 pages

Java Assignment Questions

The document outlines a comprehensive Java programming assignment covering various topics including variables, data types, operators, conditional statements, loops, patterns, functions, arrays, searching and sorting, 2D arrays, strings, object-oriented programming, recursion, divide and conquer, time and space complexity, and backtracking. Each section includes specific tasks or programs to be implemented, such as swapping numbers, calculating simple interest, and solving the N-Queens problem. This assignment is designed to enhance understanding and application of Java programming concepts.

Uploaded by

ranjith
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)
2 views2 pages

Java Assignment Questions

The document outlines a comprehensive Java programming assignment covering various topics including variables, data types, operators, conditional statements, loops, patterns, functions, arrays, searching and sorting, 2D arrays, strings, object-oriented programming, recursion, divide and conquer, time and space complexity, and backtracking. Each section includes specific tasks or programs to be implemented, such as swapping numbers, calculating simple interest, and solving the N-Queens problem. This assignment is designed to enhance understanding and application of Java programming concepts.

Uploaded by

ranjith
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

JAVA PROGRAMMING ASSIGNMENT

1. Variables and Data Types


1. Write a Java program to swap two numbers using a temporary variable.
2. Write a program to calculate simple interest.
3. Declare variables of all primitive data types and print them.
4. Write a program to convert Celsius to Fahrenheit.
5. Write a program to find the ASCII value of a character.
2. Operators
1. Demonstrate arithmetic operators.
2. Check whether a number is divisible by 5 and 11.
3. Find the maximum of three numbers using ternary operator.
4. Show the difference between == and equals().
5. Demonstrate pre and post increment.
3. Conditional Statements
1. Check whether a year is a leap year.
2. Assign grades based on marks.
3. Menu-driven calculator using switch.
4. Check vowel or consonant.
5. Find the largest of three numbers.
4. Loops
1. Print numbers from 1 to 100.
2. Find factorial of a number.
3. Generate Fibonacci series.
4. Count digits of a number.
5. Reverse a number.
5. Patterns
1. Right angled triangle pattern.
2. Number pyramid.
3. Inverted star pattern.
4. Floyd’s triangle.
5. Hollow square.
6. Functions and Methods
1. Check prime number.
2. Find maximum of two numbers.
3. Recursive factorial.
4. Power of a number.
5. Sum of array elements.
7. Arrays
1. Largest element in array.
2. Sum and average of array.
3. Reverse an array.
4. Copy array.
5. Count even and odd elements.
8. Searching and Sorting
1. Linear search.
2. Binary search.
3. Bubble sort.
4. Selection sort.
5. Compare time complexity of searches.
9. 2D Arrays
1. Read and print matrix.
2. Add two matrices.
3. Transpose of matrix.
4. Identity matrix check.
5. Diagonal sum.
10. Strings
1. Count vowels and consonants.
2. Palindrome string.
3. Reverse a string.
4. Character frequency.
5. Compare two strings.
11. Object Oriented Programming
1. Encapsulation example.
2. Inheritance example.
3. Method overloading.
4. Method overriding.
5. Interface example.
12. Recursion
1. Factorial.
2. Fibonacci.
3. Sum of digits.
4. Reverse number.
5. Power calculation.
13. Divide and Conquer
1. Binary search.
2. Merge sort.
3. Quick sort.
4. Divide and conquer explanation.
5. Min and max in array.
14. Time and Space Complexity
1. Nested loop complexity.
2. Bubble vs Merge sort.
3. Big-O notation.
4. Binary search complexity.
5. Recursive factorial complexity.
15. Backtracking
1. N-Queens problem.
2. Rat in a maze.
3. String permutations.
4. Sudoku solver.
5. Subset generation.

You might also like