Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please exaplain this java code line by line and what's there work thanks i need it it's important Hotelca te Code Analyze Befactor Build Run

please exaplain this java code line by line and what's there work thanks i need it it's important image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Hotelca te Code Analyze Befactor Build Run Tools Ves Window Help FinalProject - Hotel Controller java Hotel Controller edit IFlight.java Security.java Message java Hotel.java Mainjava ya Destinationjava Delu 96 public void edit() { 97 String[] all; 98 99 try { m 100 File myobj = new File(this.FILE_Hotels); Contro 101 Scanner myReader = new Scanner(myObj); 102 int i = 0; roller 103 while (ayReader.hasNextLine()) { 104 myReader.nextLine(); 105 186 A } 07 all = new String(1); troller 208 is ; 109 System.out.println("Please input the line number you want to edit"); 116 myReader - new Scanner(myObj); 111 while (myReader. hasNextLine()) { 112 am Files String data = RyReader.nextLine(); 113 all[i] = data; les 1++; 115 System.out.println(i +""+data); 116 117 Scanner s = new Scanner(System.in); 118 119 D do { 120 x = Integer.parseInt(s.next()); 121 if (x 0) { System.out.println("please inter the write number"); 123 } else { 124 break; 125 126 } while (true); 114 Ant Xi 122 Problems Terminal 24/2020 10:46 AM) Buld Search DU Befactor Bulld Run Tools VCS Window Help FinalProject Hotel Controlerjava edit Main va Moteljava Main.jav Destination.java Hotel Controller Destination Controller java TicketControl Securityava Message.java } while (true); System.out.println("1 for available for unailable"); String availability = s.next(); System.out.println("Hotel name"); String name next(); System.out.println("Stars"); String stars - S.next(); System.out.println("Price per night"); String pricePer Night = s.next(); System.out.println("Breakfast price"); String seats - s.next(); System.out.println("Number of roons"); String number of Rooms = .nextLine(); String editedFlight = availability","name",stars,"priceperNight," seats + number of rooms all(x - 1) - editedFlight; Printiriter writer = new Printiriter(this.FILE_Hotels, for (int j = 0; 1 writer.close(); Message. showSuccess Message(); } (Exception e) { TE DELL ES F12 Home End exam1 HotelController edit Project Users Dell ca exam1 Destination DestinationContro Hotel Hotel Controller Flight Main Message Security TicketController alproj pumi inal Project.im ROJECT pumi al Libraries 12 > Program Files aches and Consoles Flight.javax Securityjava Message.java Hotel.java Mainjava Destinationjava HotelContre 37 1=; 38 myReader = new Scanner(myObj); 39 40 while (myReader.hasNextLine()) { 41 String data = syReader.nextLine(); 42 if (data.equals(null) || data.equals("")){ continue; 44 } 45 if(data.charAt(0)== '0') { 46 continue; 47 } 48 String inputstring() = data.split( regee"); 50 51 Hotel hotel = new Hotel(); 52 for (int i = 0; i 1) { System.out.println("please inter the write number"); } else { break; } while (true); System.out.println("1 for available for unavailable"); String str = s.next(); System.out.println("country name"); String stri - s.next(); System.out.println("price"); String str2 = $.next(); System.out.println("available seats"); String seats = s.next(); String editedFlight = str + "," + stri + + seats; + str2 5 56 41-4.ht. Bold Terminal 0:46 AM) BI DELL list Hotel Messagejava Security.java Hoteljava x Mainjava Destinationjava x System.out.println("1 for available , e for unavailable"); String str = s.next(); System.out.println("country name"); String str1 = s.next(); System.out.println("price"); String str25 S.next(); System.out.println("available seats"); String seats = s.next(); String editedFlight = str. stri + "," + str2 + "," seats; all[x - 1] = editedFlight; Printwriter writer = new Printwriter(this.FILE_DESTINATION, osn: UTF-8" for (int i = 0; i 1) { System.out.println("please enter the right number"); 31 32 Build Terminal 20 10:46 AM) ch BE E Hote Refactor Build Run Tools VCS Window Help FinalProject - TicketController.java writeCustomerDetail java Security.java Messagejava Hotel.java Mainjava Destinationjava type = Integer.parseInt(s.next()); if (type 1) { System.out.println("please enter the right number"); } else { break; } } while (true); if (type == 1) { chooseHotel(); } System.out.println("your total price :" + totalPrice); this.writeCustomerDetail(); new TicketController(); // wargrtni zaniari kasi public void getUserDetail() { Scanner s = new Scanner(System.in); System.out.println("please input costumer name"); String name = s.nextLine(); System.out.println("please input costumer 10"); String id = s.nextLine(); detail += name + "," + id; } 6 7 of Sa 59 // here we get user details public void writeCustomerDetailo { try C FileWriter f = new FileWriter( tileName: "D:\\details.txt", append: true); Bufferedwriter a new BufferedWeiter(t): 60 Build Terminal 10:46 AM) Befactor Build Run Tools VCS Window Help Final Project - TicketController.java writeCustomer Detail Securityjava Messagejava Hotel java Mainjava Destination.java Hotel Controller.java FileWriter f = new FileWriter fileName "D:\\details.txt", append: true); BufferedWriter b = new BufferedWriter(t); Printwriter p = new PrintWriter(b):) { DestinationController p.println(); p.println(detail); } catch (Exception e) { 1/ here we sold ticket public void buyTicket() { Destination d; for (int 1.0; 1 this.destinations. Length) { System.out.println("please inter the write number"); } else { break; } } while (true); Build Hotel Controller.java DestinationCont ze Befactor Build Run Tools VCS Window Help Final Project - TicketControllerjava der writeCustomer Detail ht.java Securityjava Message.java Hoteljava * Mainjava Destination Java System.out.println("1 to one way , 2 for two way"); int ways: do { ways. Integer.parseInt(s.next()); D if (ways 2) { System.out.println("please inter the write number"); } else { break; } } while (true); System.out.println("1 for VIP, e for normal); int type; do { type = Integer.parseInt(s.next()); if (type 1) { System.out.println("please inter the write number"); } else { break; } while (true); Destination selecteddest = this.destinations[selectedDestination - 1); System.out.println(-You selected "selectedDest.getCountry() + " for ways" ways with price + (sel selectedDest.setAvailableSeats(selectedDest.getAvailableSeats() - 1); totalPrice ** (selectedDest.getPrice().ways) + (2. tyre ways); detail choose selectedDest.getCountry) for ways. ways with price. (selectedDest.get this.updateFlight Reservations(): D Where WOWILL choose hotel Terminal 46 AM) 8. DELL Main DestinationController java Ticino 120 hotel.getVisitors() + "roon 133 Code Aralyze Befactor Build Run Tools vcs Window Help Final Project - TicketController java cetController write CustomerDetail Flight java Securityjava Messagejava Hoteljava Mainjava Destination av Hotel Controller.java //here we will choose hotel 223 of public void choose Hotel 124 125 Hotel hotel: 126 for (int i = 0; i this.hotels.Length) { 138 System.out.println("please inter the write number"); 139 } else { 140 break; } 142 } while (true); 143 System.out.println("days?"); int days . S.nextInt(); 146 147 System.out.println("1 with breakfast, with out"); 148 int type: 149 do 250 type = Integer.parseInt(s.next(); 151 11 (type 1) { System.out.println("please inter the write number"); G 145 FinalProject - TicketController.java ganet Analyze Beactor Build Run Tools VCS Window Help TetController write Customer Detall Securityjava Message.java Hoteljava Mainjava Destination java Hote Controllerja DestinationController.java break; } while (true); Hotel selectedHotel = this. hotels(selectedhotelByuser - 1); System.out.println("you stay in selectedHotel.getName() + " for days . days and price will be " . (selectedHotel.getPrice) days) and (selectedHotel.getBreakfastPrice() .type days) . " for breakfast"); Flight selectedHotel.setVisitors(selectedHotel.getVisitors() - 1); light.java De 154 155 156 157 158 Destination 159 DestinationContro 160 Hotel Hotel Controller 161 162 Main 163 Message 164 Security 165 TicketController 166 rojpurl 167 Project.imi 169 Libraries 170 2 > Program Files 171 es and Consoles 172 173 174 175 176 177 178 179 180 268 HECT pumi totalPrice +- (selectedhotel.getPrice() . days) . (selectedhotel.getBreakfastPrice() .type days) detail += stay in selectedHotel.getName() .. for.. days." days and price will be .. (selectedHotel.getPrice() . days); } private void updateFlightReservations() { try ( FileWriter 1 = new FileWriter(ReName "C:\/conane.txt"). BufferedWriter b = new BufferediWriter(t); Printiriter p new PrintWriter(b):) { Destination destionation: (int i = 0; i 0) { System.out.println("please inter the write number"); 123 } else { 124 break; 125 126 } while (true); 114 int Xi 122 Problems Terminal 24/2020 10:46 AM) Buld Search G DAN Hotelca te Code Analyze Befactor Build Run Tools Ves Window Help FinalProject - Hotel Controller java Hotel Controller edit IFlight.java Security.java Message java Hotel.java Mainjava ya Destinationjava Delu 96 public void edit() { 97 String[] all; 98 99 try { m 100 File myobj = new File(this.FILE_Hotels); Contro 101 Scanner myReader = new Scanner(myObj); 102 int i = 0; roller 103 while (ayReader.hasNextLine()) { 104 myReader.nextLine(); 105 186 A } 07 all = new String(1); troller 208 is ; 109 System.out.println("Please input the line number you want to edit"); 116 myReader - new Scanner(myObj); 111 while (myReader. hasNextLine()) { 112 am Files String data = RyReader.nextLine(); 113 all[i] = data; les 1++; 115 System.out.println(i +""+data); 116 117 Scanner s = new Scanner(System.in); 118 119 D do { 120 x = Integer.parseInt(s.next()); 121 if (x 0) { System.out.println("please inter the write number"); 123 } else { 124 break; 125 126 } while (true); 114 Ant Xi 122 Problems Terminal 24/2020 10:46 AM) Buld Search DU Befactor Bulld Run Tools VCS Window Help FinalProject Hotel Controlerjava edit Main va Moteljava Main.jav Destination.java Hotel Controller Destination Controller java TicketControl Securityava Message.java } while (true); System.out.println("1 for available for unailable"); String availability = s.next(); System.out.println("Hotel name"); String name next(); System.out.println("Stars"); String stars - S.next(); System.out.println("Price per night"); String pricePer Night = s.next(); System.out.println("Breakfast price"); String seats - s.next(); System.out.println("Number of roons"); String number of Rooms = .nextLine(); String editedFlight = availability","name",stars,"priceperNight," seats + number of rooms all(x - 1) - editedFlight; Printiriter writer = new Printiriter(this.FILE_Hotels, for (int j = 0; 1 writer.close(); Message. showSuccess Message(); } (Exception e) { TE DELL ES F12 Home End exam1 HotelController edit Project Users Dell ca exam1 Destination DestinationContro Hotel Hotel Controller Flight Main Message Security TicketController alproj pumi inal Project.im ROJECT pumi al Libraries 12 > Program Files aches and Consoles Flight.javax Securityjava Message.java Hotel.java Mainjava Destinationjava HotelContre 37 1=; 38 myReader = new Scanner(myObj); 39 40 while (myReader.hasNextLine()) { 41 String data = syReader.nextLine(); 42 if (data.equals(null) || data.equals("")){ continue; 44 } 45 if(data.charAt(0)== '0') { 46 continue; 47 } 48 String inputstring() = data.split( regee"); 50 51 Hotel hotel = new Hotel(); 52 for (int i = 0; i 1) { System.out.println("please inter the write number"); } else { break; } while (true); System.out.println("1 for available for unavailable"); String str = s.next(); System.out.println("country name"); String stri - s.next(); System.out.println("price"); String str2 = $.next(); System.out.println("available seats"); String seats = s.next(); String editedFlight = str + "," + stri + + seats; + str2 5 56 41-4.ht. Bold Terminal 0:46 AM) BI DELL list Hotel Messagejava Security.java Hoteljava x Mainjava Destinationjava x System.out.println("1 for available , e for unavailable"); String str = s.next(); System.out.println("country name"); String str1 = s.next(); System.out.println("price"); String str25 S.next(); System.out.println("available seats"); String seats = s.next(); String editedFlight = str. stri + "," + str2 + "," seats; all[x - 1] = editedFlight; Printwriter writer = new Printwriter(this.FILE_DESTINATION, osn: UTF-8" for (int i = 0; i 1) { System.out.println("please enter the right number"); 31 32 Build Terminal 20 10:46 AM) ch BE E Hote Refactor Build Run Tools VCS Window Help FinalProject - TicketController.java writeCustomerDetail java Security.java Messagejava Hotel.java Mainjava Destinationjava type = Integer.parseInt(s.next()); if (type 1) { System.out.println("please enter the right number"); } else { break; } } while (true); if (type == 1) { chooseHotel(); } System.out.println("your total price :" + totalPrice); this.writeCustomerDetail(); new TicketController(); // wargrtni zaniari kasi public void getUserDetail() { Scanner s = new Scanner(System.in); System.out.println("please input costumer name"); String name = s.nextLine(); System.out.println("please input costumer 10"); String id = s.nextLine(); detail += name + "," + id; } 6 7 of Sa 59 // here we get user details public void writeCustomerDetailo { try C FileWriter f = new FileWriter( tileName: "D:\\details.txt", append: true); Bufferedwriter a new BufferedWeiter(t): 60 Build Terminal 10:46 AM) Befactor Build Run Tools VCS Window Help Final Project - TicketController.java writeCustomer Detail Securityjava Messagejava Hotel java Mainjava Destination.java Hotel Controller.java FileWriter f = new FileWriter fileName "D:\\details.txt", append: true); BufferedWriter b = new BufferedWriter(t); Printwriter p = new PrintWriter(b):) { DestinationController p.println(); p.println(detail); } catch (Exception e) { 1/ here we sold ticket public void buyTicket() { Destination d; for (int 1.0; 1 this.destinations. Length) { System.out.println("please inter the write number"); } else { break; } } while (true); Build Hotel Controller.java DestinationCont ze Befactor Build Run Tools VCS Window Help Final Project - TicketControllerjava der writeCustomer Detail ht.java Securityjava Message.java Hoteljava * Mainjava Destination Java System.out.println("1 to one way , 2 for two way"); int ways: do { ways. Integer.parseInt(s.next()); D if (ways 2) { System.out.println("please inter the write number"); } else { break; } } while (true); System.out.println("1 for VIP, e for normal); int type; do { type = Integer.parseInt(s.next()); if (type 1) { System.out.println("please inter the write number"); } else { break; } while (true); Destination selecteddest = this.destinations[selectedDestination - 1); System.out.println(-You selected "selectedDest.getCountry() + " for ways" ways with price + (sel selectedDest.setAvailableSeats(selectedDest.getAvailableSeats() - 1); totalPrice ** (selectedDest.getPrice().ways) + (2. tyre ways); detail choose selectedDest.getCountry) for ways. ways with price. (selectedDest.get this.updateFlight Reservations(): D Where WOWILL choose hotel Terminal 46 AM) 8. DELL Main DestinationController java Ticino 120 hotel.getVisitors() + "roon 133 Code Aralyze Befactor Build Run Tools vcs Window Help Final Project - TicketController java cetController write CustomerDetail Flight java Securityjava Messagejava Hoteljava Mainjava Destination av Hotel Controller.java //here we will choose hotel 223 of public void choose Hotel 124 125 Hotel hotel: 126 for (int i = 0; i this.hotels.Length) { 138 System.out.println("please inter the write number"); 139 } else { 140 break; } 142 } while (true); 143 System.out.println("days?"); int days . S.nextInt(); 146 147 System.out.println("1 with breakfast, with out"); 148 int type: 149 do 250 type = Integer.parseInt(s.next(); 151 11 (type 1) { System.out.println("please inter the write number"); G 145 FinalProject - TicketController.java ganet Analyze Beactor Build Run Tools VCS Window Help TetController write Customer Detall Securityjava Message.java Hoteljava Mainjava Destination java Hote Controllerja DestinationController.java break; } while (true); Hotel selectedHotel = this. hotels(selectedhotelByuser - 1); System.out.println("you stay in selectedHotel.getName() + " for days . days and price will be " . (selectedHotel.getPrice) days) and (selectedHotel.getBreakfastPrice() .type days) . " for breakfast"); Flight selectedHotel.setVisitors(selectedHotel.getVisitors() - 1); light.java De 154 155 156 157 158 Destination 159 DestinationContro 160 Hotel Hotel Controller 161 162 Main 163 Message 164 Security 165 TicketController 166 rojpurl 167 Project.imi 169 Libraries 170 2 > Program Files 171 es and Consoles 172 173 174 175 176 177 178 179 180 268 HECT pumi totalPrice +- (selectedhotel.getPrice() . days) . (selectedhotel.getBreakfastPrice() .type days) detail += stay in selectedHotel.getName() .. for.. days." days and price will be .. (selectedHotel.getPrice() . days); } private void updateFlightReservations() { try ( FileWriter 1 = new FileWriter(ReName "C:\/conane.txt"). BufferedWriter b = new BufferediWriter(t); Printiriter p new PrintWriter(b):) { Destination destionation: (int i = 0; i 0) { System.out.println("please inter the write number"); 123 } else { 124 break; 125 126 } while (true); 114 int Xi 122 Problems Terminal 24/2020 10:46 AM) Buld Search G DAN

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions