Here's my code. I have an assignment due in an hour and thankfully i found this site before it got too late. Ive been working on this for several hours and cant get this to compile.
The errors are in lines 23,27,31 ')' expected.
import java.util.Scanner; public class Final { public static void main(String[] args) { Scanner in = new Scanner(System.in); boolean again = true; int length[] = new int[128]; String titles[] = new String[128]; int numDVDs = 0; boolean quit = false; do { System.out.println(menu()); String choice = in.nextLine(); if (choice.equalsIgnoreCase("a")) { ** ==error numDVDs = addDVD(String titles[], int length[],int numDVDs); } if (choice.equalsIgnoreCase("t")) { ** ==error searchByTitle(String titles[],int length[], int numDVDs); } if (choice.equalsIgnoreCase("l")) { ** searchByLength(String titles[],int length[],int numDVDs); } if (choice.equalsIgnoreCase("q")) { quit = true; } }while (!quit); //closes while loop } //closes main public static String menu() { String response=""; System.out.println("Please enter an option"); System.out.println("*********************************"); System.out.println("A Add a DVD *"); System.out.println("T Search by Title *"); System.out.println("L Search by length *"); System.out.println("Q Quit *'"); System.out.println("********************************"); return response; } public static int addDVD(String titles[], int length[], int numDVDs) { int numDVDs = numDVDs; String titleMovie = ""; int lengthMovie = 0; int entry = 0; if(numDVDs == 128) { return 0; } else { System.out.println("Enter title");q titleMovie = in.nextLine(); System.out.println("Enter length"); lengthMovie = in.nextLine(); titles[numDVDs] = titleMovie; length[numDVDs] = lengthMovie; entry++; return entry; } } public static void searchByTitle(String titles[],int length[], int numDVDs) { System.out.println("Please enter DVD title (post * allowed) :"); String titleSearch = in.nextLine(); // search function for(int i=0; i<numDVDs; i++) { if(titleSearch == titles[i]) { System.out.println("Title :"+ titles[i]+ " Length :" + length[i]); } else if(title[i].startsWith(titleSearch)) { System.out.println("Titles//////////////////////////Lengths"); System.out.println("Title :" + titles[i] + " Length :" + length[i]); } else { System.out.println("Movie not found"); } return; } } public static void searchByLength(String titles[],int length[], int numDVDs) { int lengthSearch =0; System.out.println("Enter length for search"); lengthSearch = in.nextLine(); char option = lengthSearch.charAt(0); int length = Integer.parseInt(lengthSearch.substring(1)); System.out.println("Titles/////////////////Length"); System.out.println("*****************************"); for (int i = 0; i < numDVDs; i++) { if (option == '=') { if(lengthSearch == length[i]) { System.out.println(titles[i] + "\t" + length[i]); } } else if (option == '<') { if(lengthSearch<length[i]) { System.out.println(title[i] + "\t" + length[i]); } } else if (option == '>') { if(lengthSearch<length[i]) { System.out.println(titles[i] + "\t" + length[i]); } else { System.out.println("Movie not found"); } return; } } }