Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. 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)
  2. {
  3. int i, j;
  4. int match_count= 0;
  5. double total=0;
  6. String search_city = "";
  7. String output = "Enter the City from a particular flight you are searching for";
  8. search_city = JOptionPane.showInputDialog(null,
  9. output, " ",
  10. JOptionPane.QUESTION_MESSAGE);
  11. for (i = 0; i <=count; ++i) {
  12. if(origin[i].equals(search_city))
  13. {
  14. System.out.println(flight[i]+" "+flight_number[i]+" "+origin[i]+" "+destination[i]+" "+date[i]+" "+time[i]);
  15. }
  16. //section in question
  17. for (j = 0; j <=rcount; ++j) {
  18. if(fl_number[j] == flight_number[i])
  19. {
  20. total+=match_count+1;
  21. }
  22. }
  23. System.out.println("The total reservations for " +search_city+ " = " +total);
  24. }
  25. }// method city_origin
  26.  
  27. public static void exit_program()
  28. {
  29. System.out.println("Executing exit_program");
  30. }//method exit_program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement