This project is a console-based sorting program written in Java.
It allows users to input complaint priority levels and sorts them using either Selection Sort or Bubble Sort. The program then outputs the lowest three priorities to represent the intern queue.
- Parse user input of priorities (comma-separated integers)
- Choose sorting algorithm:
- Selection Sort (default)
- Bubble Sort
- Validate input format
- Ensure at least 3 priorities are provided
- Display the lowest three priorities after sorting
InputParser.java→ Parses comma-separated input into integer arraysComplaintService.java→ Provides logic to get the lowest three prioritiesSelectionSort.java→ Implements selection sort algorithmBubbleSort.java→ Implements bubble sort algorithmSortStrategy.java→ Interface for sorting strategiesInternQueueSorter.java→ Main program with CLI options
- Open Command Prompt and navigate to the folder containing your files:
cd C:\Users\YourName\InternQueueSorter\src - Compile all Java files:
javac *.java
- Run the program with input
- Default (Selection Sort):
java InternQueueSorter 10,8,2,6,4
- Selection Sort:
java InternQueueSorter --algorithm=selection 10,8,2,6,4
- Bubble Sort:
java InternQueueSorter --algorithm=bubble 10,8,2,6,4
- Default (Selection Sort):