/*Imports Java library files*/
import javax.swing.JOptionPane;
import java.text.*;
/*Filename for programs class*/
class KwikKapers
{
/*Runs program- method*/
public static void main(String[] args)
{
KwikKapers optpane = new KwikKapers();
}
/*Constructor*/
public KwikKapers()
{
/*Instruction to begin start menu method*/
Startmenu();
}
/*Method for main start menu*/
public void Startmenu()
{
/*Booleen statement to keep program running so long as an input is selected*/
while (true)
{
/*String array value containing questions for the start menu*/
String [] startquest = new String[]{"• What is the duration and destination of flight?","• What flights and destinations are available from?","• What flights land at ?",
"• What time are flights of no more than?","• What time does the flight from ? arrive in ?",
"• What is the full information for a route from ? to ?"};
/*Object for start displaying questions from String values already declared. Displayed in JOptionPane */
Object start = JOptionPane.showInputDialog(null,"What do you want to do?",
"Kwik Khemists Enquiries",JOptionPane.QUESTION_MESSAGE,null, startquest,"Category of name entered");
/*If statement used to close program if cancel button is pressed*/
if (start==null)
{
System.exit(0);
}
/*Else if statement used to start method if start = String below*/
else if (start.equals("• What is the duration and destination of flight?"))
{
Categoryduration();
}
/*Else if statement used to start method if start = String below*/
else if (start.equals("• What flights and destinations are available from ?"))
{
Destinations();
}
/*Else if statement used to start method if start = String below*/
else if (start.equals("• • What time are flights of no more than ? hours from ?"))
{
NomoreThan();
}
/*Else if statement used to start method if start = String below*/
else if (start.equals("What time does the flight from ? arrive in ?"))
{
FlightTime();
}
/*Else if statement used to start method if start = String below*/
else if (start.equals("What is the full information for a route from ? to ?"))
{
infomation();
}
}
}
scunnywhite
0
Newbie Poster
Recommended Answers
Jump to Post1) Put code between [code] [/code] tags when posting it (There is a button that will surround highlighted text with code tags in the toolbar of the post editor as well)
2) Compiler errors tell you explicitly what the problem is and on what line it occurs. Read them. Post …
All 4 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
scunnywhite
0
Newbie Poster
scunnywhite
0
Newbie Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.