hi guys just joined the site im new to programming taking a course in uni started this year and had no previous programming knowledge before i started
import javax.swing.*; class Project { public static void main (String [] args) { String Title [] = new String [5]; // array 1 int Length [] = new int [5]; // array 2 String Artist [] = new String [5]; // array 3 Menu(Title, Length, Artist); } public static void Menu(String Title [],int Length [] , String Artist []) { //menu given, user can choose from options, has been converted into int for the next part int Menu = Integer.parseInt(JOptionPane.showInputDialog("\t" + "\t" +"Menu" + "\n" + "If you would like to enter more collections please enter: 1" + "\n" + "If you would like to search for a specific song please enter: 2" + "\n" + "If you would like to print the whole collection please enter: 3" + "\n" + "If you would like to terminate the program enter: 4")); //if else statments will tell the program what to do with the information entered by the user. if (Menu == 1) { Input(Title, Length, Artist); } else if (Menu == 2) { Search(Title, Length, Artist); } else if (Menu == 3) { Print(Title, Length, Artist); } else if (Menu == 4) { final int Quit = 4; } else if ((Menu < 1) || (Menu > 4)) { JOptionPane.showMessageDialog(null, "Invalid entry please click OK to choose again"); } } // method to input information public static void Input(String Title [], int Length [] , String Artist []) { // this loop here fills my arrays for (int count = 0; count < 5; count++) { String title = JOptionPane.showInputDialog("Enter Title of the Song");// this will fill array 1 return Title[count] = title; int length = Integer.parseInt(JOptionPane.showInputDialog("Enter Length of the song in Seconds"));// this will fill array 2 return Length[count] = length; String artist = JOptionPane.showInputDialog("Enter the name of the Artist");// this will fill array 3 return Artist[count] = artist; } Menu(Title, Length, Artist); } // method to search public static void Search(String Title [], int Length [] , String Artist []) { int Find = Integer.parseInt(JOptionPane.showInputDialog("Please Enter the Array you would like to access")); if (Find == 0) { JOptionPane.showMessageDialog(null, Title[0] + " " + Length[0] + " " + Artist[0]); } else if (Find == 1) { JOptionPane.showMessageDialog(null, Title[1] + " " + Length[1] + " " + Artist[1]); } else if (Find == 2) { JOptionPane.showMessageDialog(null, Title[2] + " " + Length[2] + " " + Artist[2]); } else if (Find == 3) { JOptionPane.showMessageDialog(null, Title[3] + " " + Length[3] + " " + Artist[3]); } else if (Find == 4) { JOptionPane.showMessageDialog(null, Title[4] + " " + Length[4] + " " + Artist[4]); } Menu(Title, Length, Artist); } //method to print the whole colloction available public static void Print(String Title [], int Length [] , String Artist []) { // print out entire array (collections) JOptionPane.showMessageDialog(null, "1 " + Title[0] + " " + Length[0] + " " + Artist[0] + "\n" + "2 " + Title[1] + " " + Length[1] + " " + Artist[1] + "\n" + "3 " + Title[2] + " " + Length[2] + " " + Artist[2] + "\n" + "4 " + Title[3] + " " + Length[3] + " " + Artist[3] + "\n" + "5 " + Title[4] + " " + Length[4] + " " + Artist[4] + "\n"); Menu(Title, Length, Artist); } //method to quit public static void Quit() { System.exit(0); } }
this is my error