This repository contains a series of Java programming assignments designed to strengthen your understanding of fundamental programming concepts, algorithms, and problem-solving techniques. Each assignment focuses on a specific topic, ranging from basic array manipulation to more complex string processing and mathematical calculations.
- Finding the 2nd Highest CGPA
- Sorting CGPA Array
- Binary Search on CGPA Array
- Random Number Array
- Break Down Amount into Notes
- Pattern Printing
- Finding the 2nd Lowest Height
- String Analysis
- Character Frequency Counter
- Finding Unique Numbers
- Summing User Input
- Cost Calculation with Discount
Objective: Write a program to find the student with the 2nd highest CGPA from a list of CGPAs using a linear search algorithm.
Concepts Used:
- Arrays
- Linear search
Objective: Sort the array of CGPAs in descending order without using built-in sorting methods.
Concepts Used:
- Arrays
- Sorting algorithms (e.g., Bubble sort)
Objective: Implement a binary search to find if a given CGPA exists in the array. Assume the array is already sorted.
Concepts Used:
- Binary search
- Arrays
- User input
Objective: Generate an array of 10 random integers, print all numbers, and find the maximum and minimum values.
Concepts Used:
- Random number generation
- Arrays
- Looping
Objective: Given an amount of money, break it down into the fewest number of currency notes possible.
Concepts Used:
- Arrays
- Greedy algorithm
Objective: Write a program to print a specific pattern (first decrement 5-1, then increment 1-5).
Concepts Used:
- Nested loops
- String manipulation
Objective: Write a program to find the 2nd lowest height among 10 babies without using a built-in sort method.
Concepts Used:
- Arrays
- Linear search
Objective: Analyze a string to count the number of words, characters (excluding spaces), vowels, and consonants.
Concepts Used:
- String manipulation
- Looping
Objective: Count the frequency of each character in a string.
Concepts Used:
- Strings
- HashMaps (optional for advanced implementation)
- Looping
Objective: Find and print the numbers in an array that are not duplicated.
Concepts Used:
- Arrays
- Looping
- Conditional logic
Objective: Continuously take integer input from the user and print the sum until the user inputs q. If a non-integer character is input, ask for input again.
Concepts Used:
- User input
- Loops
- Conditional statements
Objective: Calculate the total cost of a laptop and a mouse after a 15% discount is applied.
Concepts Used:
- Arithmetic operations
- String parsing
- Install Java: Ensure you have JDK installed on your system.
- Compile and Run: Use the javac command to compile the .java files and java command to run them.
- javac Assignment.java
- java Assignment