Add to Favorites    Make Home Page 41463 Online  
 Language Categories  
 Our Services  

Home » Java Home » Beginners / Lab Assignments Home » Reservation (Mini Project)

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Reservation (Mini Project)
Author Mubasher Afzal
Author Email mubasherafzal [at] yahoo.com
Description The reservation system code which register a passenger for differenct categories. this will also tells the current status of seats.
littel programe but can be helpful in developing big applications

Category Java » Beginners / Lab Assignments
Hits 89069
Code Select and Copy the Code
Code : //Mubasher Afzal //mubasherafzal@yahoo.com import javax.swing.JOptionPane; import javax.swing.JTextArea; public class Reservation1 { public static int smoking[]=new int[5]; public static int nons[]=new int[5]; public static void main(String args[]) { String output="Enter 1 for smoking "+ "Enter 2 for nons Enter 3 for seats info "+ "Enter 4 for Exit"; JOptionPane.showMessageDialog(null,output,"Reservation System",JOptionPane.INFORMATION_MESSAGE); String ch=JOptionPane.showInputDialog("Enter a choice"); int choice=Integer.parseInt(ch); int i=0,j=0; while(choice !=4) { switch(choice) { case 1: if(i>4 ){ JOptionPane.showMessageDialog(null,"All seats are book in smoking section "+ " Do u want a seat in nons"); break;} smoking(i); i++; break; case 2: if(j>4){ JOptionPane.showMessageDialog(null,"All seats are book in nonsmoking section "+ "Do u want a seat in smoking"); break;} nons(j); j++; break; case 3: status(); break; default: JOptionPane.showMessageDialog(null,"You enter awrong choice "+"enter again"); } ch=JOptionPane.showInputDialog("Enter a choice"); choice=Integer.parseInt(ch); } System.exit(0); } public static void smoking(int x) { /* if(x>4){ break; }*/ String name=JOptionPane.showInputDialog("Enter pas name"); smoking[x]=1; String output="passenger name--"+name+ " seat no--"+x+" Smoking section"; JOptionPane.showMessageDialog(null,output,"Boarding Pass",JOptionPane.INFORMATION_MESSAGE); } public static void nons(int y) { String name=JOptionPane.showInputDialog("Enter pas name"); nons[y]=1; String output="passenger name--"+name+ " seat no--"+y+" NonSmoking section"; JOptionPane.showMessageDialog(null,output,"Boarding Pass",JOptionPane.INFORMATION_MESSAGE); } public static void status() { int t; JTextArea outputArea=new JTextArea(20,30); outputArea.append("Smoking nonSmoking "); for( t=0;t<5;t++) outputArea.append(smoking[t]+" "+nons[t]+" "); JOptionPane.showMessageDialog(null,outputArea,"seat info",JOptionPane.INFORMATION_MESSAGE); } }

Related Source Codes

Script Name Author
Sending mail Using JavaMail to Yahoo and Gmail accounts sai prasad
Simple Program in Java to Implement Multithreading Satish.K
Simple Calculator in Java Using Remote Method Invocation Satish.K
Guest Book Application Using Servlets Satish.K
String Manipulation Using Stringification Satish.K
String Manipulation Using Stringification Satish.K
Moving Ball Application Using Java Beans Satish.K
Rapid Roll game subrahmanyeswararao
student mgm arpan
Sourav Datta
Download Manager Sagar
Address Book in Java Rahul Chouhan
address book using java database connectivity(jdbc-msaccess) shekhar bansal
sun Steganography B.Rajavel
Connecting Java with MS-Access - Inserting data in Aseem

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions
Copyright ©2003-2017 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=922


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review