Small Java project ideas that stick strictly to loops, if-else, methods, and arrays
Here are some small Java project ideas that stick strictly to loops, if-else, methods, and arrays, without using OOP or collections like ArrayList, HashMap, etc.:
---
1. Student Marks Calculator
Features:
Input marks for 5 subjects using an array.
Calculate total, average, and grade using if-else.
Concepts: Arrays, methods, if-else, for loop.
---
2. Simple ATM Simulation
Features:
Balance check, withdraw, deposit.
Use if-else for logic and a loop for repeated menu display.
Concepts: Methods, loops, if-else.
---
3. Number Guessing Game
Features:
Random number (use Math.random()).
User tries to guess it with hints (higher/lower).
Concepts: Loops, if-else, methods.
---
4. Prime Numbers in Range
Features:
Input a range and print all prime numbers in it.
Concepts: Loops, if-else, methods.
---
5. Simple Calculator
Features:
Menu for add, subtract, multiply, divide.
Call a separate method for each operation.
Concepts: Methods, if-else.
---
6. Array Sorting (Bubble Sort)
Features:
Input array elements.
Sort using bubble sort (no Arrays.sort()).
Concepts: Arrays, nested loops, methods.
---
7. Frequency Counter in Array
Features:
Count how many times each element appears.
Avoid using collections.
Concepts: Arrays, nested loops, if-else.
---
8. Tic Tac Toe Game (2-player)
Features:
3x3 grid using 2D array.
Players take turns.
Concepts: Arrays, loops, if-else.
Comments
Post a Comment