All pastes #1000833 Raw Edit

Someone

public javascript v1 · immutable
#1000833 ·published 2008-04-28 20:09 UTC
rendered paste body
import javax.swing.JOptionPane;public class hotel{	public static void location(){		String location;		int a;		do            	{            		            							location= JOptionPane.showInputDialog("please chose a location :\n1-Le Marin Salmiya \n"+		                                                                     "2-Le Marin Shwaikh  \n"+                                                                               "3-Le Marin Beda' \n"+                                                                             "4- to quit");            	            		a=Integer.parseInt(location);                 	            		switch (a)            		{	            		case 1:	            		case 2:          		            			case 3:            			menu();            			break;            			            		         case 4 :            		         break;            		}                          		                   						}  while (a !=4);		}	public static void menu()	{		String menu;		int b;					do            	{            		            							menu= JOptionPane.showInputDialog("Press:\n1-if you want to reserve a room \n"+		                                                                     "2-spcial offers  \n"+                                                                               "3-Hear about the hotel facilities \n"+                                                                             "4-to quit");            	            		b=Integer.parseInt(menu);                 	            		switch (b)            		{	            		case 1:            			ReserveRoom();            			break;            			            		case 2:     	        	//	Offers();        	    		break;            		            			case 3:            		//	Facilities();            			break;            	                  	        case 4 :            	        break;            		}                          		                   						}  while (b !=4);		}	public static void ReserveRoom()	{			String reserve;			int r;			do{			reserve =JOptionPane.showInputDialog(null," Please chose from the following list \n"+																			"1- Studio (suitable for 1-2 people) \n"+		                               										"2- Suite ( suitable for 3-5 people  ) \n "+		                               										"3- Lamarin suite ( suitable for 5-10 people) \n"+		                               										"4-pentahouse (for royal treatment )\n" +		                               										"or press 5 to go back to the previous menu\n");		                               										            		r=Integer.parseInt(reserve);                 	            		switch (r)            		{	            		case 1:            			reserve="Suite";            			menu2();            			break;            			            		case 2:     	        		reserve="studio";    	        		menu2();        	    		break;            		            			case 3:            			reserve="Lamarin suite";            			menu2();            		  	break;            	                  	        case 4 :            	        reserve="pentahouse";            	        menu2();            	        break;            	                    	        case 5:            	        menu();            	        break;            	                    	        case 6:            	        break;		}		}while (r!=6);	}		public static void menu2(){	String confirm;			int c;			do{			confirm =JOptionPane.showInputDialog(null," You resirved a \n"+ ReserveRoom.reserve +																			"to confirm press 1 \n"+		                               										"2- to change reservation options \n "+		                               										"3- back to the hotel choices menu \n"		                               									);		                               										            		c=Integer.parseInt(reserve);                 	            		switch (c)            		{	            		case 1:            			conformation();            			break;            			            		case 2:     	        		ReserveRoom();        	    		break;            		            			case 3:            			menu();            		  	break;            	                  	        case 4:            	        break;            	        		}		}while (c!=4);			}			public static void main (String args[])	{		String choice;		int a;				do 		{			choice = JOptionPane.showInputDialog("Welcome to LeMarin hotel  , choose (1) to enter the reservation menu  \n"+     	 									                                 " or press 2 to exit the program\n");     	 									                                      	 	a=Integer.parseInt(choice);     	 	     	      		switch (a)     	 	{     	 	     	 	     	 		case 1:     	 	     	 	location();     	 	    break;     	 	     	 		     	 	    case 2:						JOptionPane.showMessageDialog(null,"Good bye \n ");                break;     	      	        default:     	              	JOptionPane.showMessageDialog(null,"wrong choice");			}				} while (a != 2);     	 								                                 	}}