-
Array Sorting Program (ArraySorting.java) Description: The Array Sorting program takes user input for an array of integers, sorting the elements in descending order using the Bubble Sort algorithm. The program prompts the user for the array size and individual elements, then prints the sorted array.
-
Array Statistics Program (ArrayStatistics.java) Description: The Array Statistics program calculates statistical measures (median, variance, standard deviation, and sum of squares) for an array of integers. It prompts the user for the array size and elements, sorts the array in ascending order, and then performs the statistical calculations.
-
Matrix Multiplication Program (MatrixMultiplication.java) Description: The Matrix Multiplication program performs matrix multiplication for two matrices. It prompts the user for the dimensions and elements of the matrices, calculates the product using the Strassen algorithm for larger matrices, and prints the resulting matrix.
General Information: Input Handling:
All programs use the Scanner class for user input. Users provide input for array sizes, matrix dimensions, and individual elements. Functionality:
Array Sorting:
Utilizes the Bubble Sort algorithm to sort an array in descending order. Prints the sorted array. Array Statistics:
Calculates the median, variance, standard deviation, and sum of squares for an array of integers. Uses Bubble Sort for sorting and specific methods for statistical calculations. Prints the calculated statistics. Matrix Multiplication:
Performs matrix multiplication for two matrices. Utilizes the Strassen algorithm for efficient multiplication of larger matrices. Prints the resulting matrix. Code Organization:
Each program consists of a main method for execution and additional methods for specific functionalities. Methods are appropriately named to reflect their purpose, promoting code readability. User Guidance:
Users are guided through prompts to provide input for array sizes, elements, and matrix details. Clear and concise output is provided for the sorted array and the result of matrix multiplication. Conclusion: The provided Java programs offer functionality for sorting arrays, calculating array statistics, and performing matrix multiplication. The code is organized, with a focus on modularity and user-friendly input handling. Each program serves its specific purpose, catering to users' needs for array manipulation and matrix operations.