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 Fall24.java.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 Fall24;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
public class Fall24
{
public static void main(String[] args)
{
//flight arrays
int[] number = new int[100];
String[] origin = new String[100];
String[] dest = new String[100];
String[] date = new String[100];
String[] time = new String[100];
int[] seats = new int[100];
int fcount =-1;
int selection;
fcount = read_flight(fcount, number, origin, dest, date, time, seats);
selection=Menu();
while (selection!=3)
{
if (selection==1)
add_flight();
else
if (selection==2)
selection = Menu();
}
report(fcount, number, origin, dest, date, time, seats);
Exit_airline();
System.exit(0);
}
public static int read_flight(int fcount, int[] number, String[] origin, String[] dest, String[] date, String[] time, int[] seats)
{
String newLine;
try
{
BufferedReader flight_file = new BufferedReader(new FileReader("flight.txt"));
while ((newLine = flight_file.readLine())!= null)
``````
{
StringTokenizer delimiter = new StringTokenizer(newLine,"#");
fcount=fcount+1;
number[fcount]= Integer.parseInt(delimiter.nextToken());
origin[fcount]= delimiter.nextToken();
dest[fcount]= delimiter.nextToken();
date[fcount]= delimiter.nextToken();
time[fcount]= delimiter.nextToken();
seats[fcount]= Integer.parseInt(delimiter.nextToken());
}
flight_file.close();
}
catch (IOException error)
{
System.out.println("Error on file read "+ error);
}
return fcount;
}
public static void add_flight()
{
System.out.println("insert code here for add flight");
}
public static void report(int fcount, int[] number, String[] origin, String[] dest, String[] date, String[] time, int[] seats)
{
int selection;
String value;
String words= "Acme Airlines"+"
"+
"1. All flight Info"+"
"+
"2. Info on Specific flight"+"
"+
"3. Number of seats on all flights"+"
"+
"4. All flights to a specific city"+"
"+
"5. All flights from a specific city"+"
"+
"6. All flights with less than 150 seats"+"
"+
"7. Exit Report Menu"+"
"+
Please make your selection ";
value=JOptionPane.showInputDialog(null, words, "Input Data", JOptionPane.QUESTION_MESSAGE);
selection=Integer.parseInt(value);
while (selection !=7)
{
if (selection ==1)
``````
{
System.out.println("ALL FLIGHT INFORMATION");
System.out.println("=====================");
for (int i=0; i=fcount; ++i)
{
System.out.println(number[i]+""+origin[i]+""+dest[i]+""+date[i]+""+time[i]+""+seats[i]);
}
else
}//end of report 1
if (selection ==2)
{
System.out.println("Insert Code here for Report #2");
}//end of report 2
else
if (selection ==3)
{
System.out.println("Insert Code here for Report #3");
}//end of report 3
else
if (selection ==4)
{
System.out.println("Insert Code here for Report #4");
}//end of report 4
else
if (selection ==5)
{
System.out.println("Insert Code here for Report #5");
}//end of report 5
else
if (selection ==6)
{
System.out.println("Insert Code here for Report #6");
}//end of report 6
value=JOptionPane.showInputDialog(null, words, "Input Data", JOptionPane.QUESTION_MESSAGE);
selection=Integer.parseInt(value);
}//end of while loop
}//end of report
public static int Menu()
{
int selection;
String words,data;
words="Acme Airline "+"
"+"
"+
"1. Add Flight" +"
"+
"2. Report Section" +"
"+
"3. Exit the system" +"
"+"
"+
``````
words="Acme Airline "+"
"+"
"+
"1. Add Flight" +"
"+
"2. Report Section" +"
"+
"3. Exit the system" +"
"+"
"+
"Please Make your selection>";
data = JOptionPane.showInputDialog(null,words,"Acme Airline ",JOptionPane.QUESTION_MESSAGE );
selection = Integer.parseInt(data);
return selection;
}
public static void Exit_airline()
{
System.out.println("insert code here for exit airline");
}
}
```
This project will read a data file into a set of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!