Hi, I'm new here and I really need help for my assignment. It's about to be submitted tomorrow but I still can't find the solution. So here's the question :
Define an executable Java class that will ask user to input three students’ names and the names are kept in an array. The subjects taken by each of these students are English, Mathematics, and History, and these subjects are kept in another array. Allow the user to enter the marks of al the three subjects for each of these three students and these marks will be kept in a multidimensional array. Prompt the user to choose the output format by entering either “By Name” or “By Subject”. If the user entered “By Name”, the program will display the output as shown in the example below:
English Mathematics History
Khatijah 83 72 65
Maniam 86 80 76
Chong 81 75 70
If the user entered “By Subject”, the program will display the output as shown in the example below:
Khatijah Maniam Chong
English 83 86 81
Mathematics 72 78 75
History 65 76 70
Use the method in JOptionPane class to get the all input from user. You are required to get and display these information using loops. You may use either the equals() or compareTo() methods for the Strings comparison to check the user’s input for the display format.