Write a Java procedural program that helps organise travellers with a specific travel company arriving at an airport, telling them which queue to join based on their hotel. The program asks each traveller what their hotel is (the choices are the Seaview for which they need to join Queue 1, the Majestic for which they need to join Queue 4 and the Grand for which they need to join Queue 7) and tells them the right queue. There are 1330 travellers with the tour company and each will use the program as they arrive. After all have indicated their hotel, the program then prints the percentage in each hotel. * See image for an example run of the program. Percentages should be printed truncated to two decimal places. Do this using a method you write yourself that multiplies by 100, converts to an integer then divides by 100.  * must make use of a counter-controlled for loop, be in procedural programming style (not OOP)

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 4.4CP
icon
Related questions
Question

Write a Java procedural program that helps organise travellers with a specific travel company arriving at an airport, telling them which queue to join based on their hotel. The program asks each traveller what their hotel is (the choices are the Seaview for which they need to join Queue 1, the Majestic for which they need to join Queue 4 and the Grand for which they need to join Queue 7) and tells them the right queue. There are 1330 travellers with the tour company and each will use the program as they arrive. After all have indicated their hotel, the program then prints the percentage in each hotel.

* See image for an example run of the program. Percentages should be printed truncated to two decimal places. Do this using a method you write yourself that multiplies by 100, converts to an integer then divides by 100. 

* must make use of a counter-controlled for loop, be in procedural programming style (not OOP)

 

Next please:
Welcome traveller 1: what is your hotel? Grand
You must join Queue 7.
Next please:
Welcome traveller 2: what is your hotel? Grand
You must join Queue 7.
Next please:
Welcome traveller 3: what is your hotel? Seaview
You must join Queue 1.
Next please:
Welcome traveller 4: what is your hotel? Majestic
You must join Queue 4.
...
Next please:
Welcome traveller 1328: what is your hotel? Grand
You must join Queue 7.
Next please:
Welcome traveller 1329: what is your hotel? Majestic
You must join Queue 4.
Next please:
Welcome traveller 1330: what is your hotel? Grand
You must join Queue 7.
25.39% of travellers are staying in the Seaview.
25.49% of travellers are staying in the Majestic.
49.12% of travellers are staying in the Grand.
Transcribed Image Text:Next please: Welcome traveller 1: what is your hotel? Grand You must join Queue 7. Next please: Welcome traveller 2: what is your hotel? Grand You must join Queue 7. Next please: Welcome traveller 3: what is your hotel? Seaview You must join Queue 1. Next please: Welcome traveller 4: what is your hotel? Majestic You must join Queue 4. ... Next please: Welcome traveller 1328: what is your hotel? Grand You must join Queue 7. Next please: Welcome traveller 1329: what is your hotel? Majestic You must join Queue 4. Next please: Welcome traveller 1330: what is your hotel? Grand You must join Queue 7. 25.39% of travellers are staying in the Seaview. 25.49% of travellers are staying in the Majestic. 49.12% of travellers are staying in the Grand.
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage