Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void city_origin(int count,String[]flight,int[]flight_number,String[]origin,String[]destination,String[]date,String[]time, int rcount, int[]fl_number)
- {
- int i, j;
- int match_count= 0;
- double total=0;
- String search_city = "";
- String output = "Enter the City from a particular flight you are searching for";
- search_city = JOptionPane.showInputDialog(null,
- output, " ",
- JOptionPane.QUESTION_MESSAGE);
- for (i = 0; i <=count; ++i) {
- if(origin[i].equals(search_city))
- {
- System.out.println(flight[i]+" "+flight_number[i]+" "+origin[i]+" "+destination[i]+" "+date[i]+" "+time[i]);
- }
- //section in question
- for (j = 0; j <=rcount; ++j) {
- if(fl_number[j] == flight_number[i])
- {
- total+=match_count+1;
- }
- }
- System.out.println("The total reservations for " +search_city+ " = " +total);
- }
- }// method city_origin
- public static void exit_program()
- {
- System.out.println("Executing exit_program");
- }//method exit_program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement