Question: This project will read a data file into a set of parallel arrays. You MUST study arrays as well as methods in your book and
This project will read a data file into a set of parallel arrays.You MUST study arrays as well as methods in your book and review all information on blackboard
using the file Falljava.You are to use this file to complete the project.This file contains calls to methods that are stubs. The program will call the proper stub methods, but each one does not do anything except run at the proper time.You must add the proper code to each method to perform the actions listed below.Please note that there are a number of programs and files stored with this assignment that will help you to understand what has to be done in each method.
package Fall;
import java.ioBufferedReader;
import java.ioFile;
import java.ioFileReader;
import java.ioIOException;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
public class Fall
public static void mainString args
flight arrays
int number new int;
String origin new String;
String dest new String;
String date new String;
String time new String;
int seats new int;
int fcount ;
int selection;
fcount readflightfcount number, origin, dest, date, time, seats;
selectionMenu;
while selection
if selection
addflight;
else
if selection
selection Menu;
reportfcount number, origin, dest, date, time, seats;
Exitairline;
System.exit;
public static int readflightint fcount, int number, String origin, String dest, String date, String time, int seats
String newLine;
try
BufferedReader flightfile new BufferedReadernew FileReaderflighttxt;
while newLine flightfile.readLine null
StringTokenizer delimiter new StringTokenizernewLine#;
fcountfcount;
numberfcount Integer.parseIntdelimiternextToken;
originfcount delimiter.nextToken;
destfcount delimiter.nextToken;
datefcount delimiter.nextToken;
timefcount delimiter.nextToken;
seatsfcount Integer.parseIntdelimiternextToken;
flightfile.close;
catch IOException error
System.out.printlnError on file read error;
return fcount;
public static void addflight
System.out.printlninsert code here for add flight";
public static void reportint fcount, int number, String origin, String dest, String date, String time, int seats
int selection;
String value;
String words "Acme Airlines"
All flight Info"
Info on Specific flight"
Number of seats on all flights"
All flights to a specific city"
All flights from a specific city"
All flights with less than seats"
Exit Report Menu"
Please make your selection ;
valueJOptionPane.showInputDialognull words, "Input Data", JOptionPane.QUESTIONMESSAGE;
selectionInteger.parseIntvalue;
while selection
if selection
System.out.printlnALL FLIGHT INFORMATION";
System.out.println;
for int i; ifcount; i
System.out.printlnnumberioriginidestidateitimeiseatsi;
else
end of report
if selection
System.out.printlnInsert Code here for Report #;
end of report
else
if selection
System.out.printlnInsert Code here for Report #;
end of report
else
if selection
System.out.printlnInsert Code here for Report #;
end of report
else
if selection
System.out.printlnInsert Code here for Report #;
end of report
else
if selection
System.out.printlnInsert Code here for Report #;
end of report
valueJOptionPane.showInputDialognull words, "Input Data", JOptionPane.QUESTIONMESSAGE;
selectionInteger.parseIntvalue;
end of while loop
end of report
public static int Menu
int selection;
String words,data;
words"Acme Airline
Add Flight"
Report Section"
Exit the system"
words"Acme Airline
Add Flight"
Report Section"
Exit the system"
"Please Make your selection;
data JOptionPane.showInputDialognullwords,"Acme Airline JOptionPane.QUESTIONMESSAGE ;
selection Integer.parseIntdata;
return selection;
public static void Exitairline
System.out.printlninsert code here for exit airline";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
