This assignment uses the program made in Assignment 3.1, the travel reservation.

Objectives

The goal of this assignment is to practice the following:

Computer Science Principles Curriculum

Common Core Standards

Vocabulary

Overview

This assignment follows a different format than previous assignments. It does not have examples and activities, rather a list of changes to make to you existing program. Use what you have learned to make new changes to the logic, and add to the program to comply with the growing demand at the travel agency. The program checks for the user input. The program then asks the user to enter the value again if an incorrect value has been entered. The program also offers better options to give a client some flexibility with making a travel reservation.

Tasks to Complete to Meet all Ovjectives

A small travel agency in St. Louis is growing and adding a couple of new destinations. More and more clients flock to the travel agency to make reservations. The travel agency needs to improve its existing program for better functionality and flexibility.

Before getting started with this assignment, create a new project and name it NewTravel. Copy the existing code from the Travel project and paste it into a new project. All code should be in the main class as before. Run the program to make sure it works properly before moving on to make changes to the program.


Make changes to the code that handles invalid input by implementing the following:


The travel agency wants to offer better flexibility by allowing the client an option of booking any reservation or just opting out of the program. Make changes to the program in the following ways:



Review the following logic to ensure that the program will provide the appropriate output to the client:


The travel agency has added a couple of new destinations, so add the following destinations to the list:

______________________________________________________________________________________________________________________________________________________________________________
Destination -> Round Trip Fare
______________________________________________________________________________________________________________________________________________________________________________
Honolulu -> $650.00
______________________________________________________________________________________________________________________________________________________________________________
New York City -> $290.00
______________________________________________________________________________________________________________________________________________________________________________
San Francisco -> $359.00



Sample Output

The input dialog statements are included in the sample output. This is just a sample, your program may run slightly differently.

Welcome to the travel agency. You offer travel packages for your vacation destinations.
How many people will be traveling? 
0
Error: The number of travelers must be one or more. Please try again. You entered 0
How many people will be traveling?
2
Select one of the destinations to book a flight: 1 - Chicago ($200), 2 - Honolulu ($650), 3 - Los Angeles ($360), 4 - Miami ($320), 5 - New York City ($290), 6 - Orlando ($310), 7 - San Francisco (5359), 8 - Seattle ($330)
Would you like to make a reservation for flights (Y/N)? 
w
Error: The input must be Y, y, N, or n. Please try again. You entered w
Would you like to make a reservation for flights (Y/N)?
Y
Enter the destination number:
9
Error: The destination number must be between 1 and 8. Please try again. You entered 9
Enter the destination number:
Would you like to include hotel in your package (Y/N)?
yy
Error: The input must be Y, y, N, or n. Please try again. You entered yy
Would you like to include hotel in your package (Y/N)?
y
What kind of hotel would you like to book? 1 - Motel ($49.99), 2 - Standard Hotel ($98.50), 3 - Luxury Hotel ($199.75)
Enter the hotel number:
5
Error: The hotel type number must be between 1 and 3. Please try again. You entered 5
Enter the hotel number:
3
Enter a number of hotel rooms:
-1
Error: The number of hotel room must be one or more. Please try again. You entered -1
Enter a number of hotel rooms:
1
Enter a number of nights to stay at the hotel:
0
Error: The number of nights must be one or more. Please try again. You entered 0
Enter a number of nights to stay at the hotel:
5
The reservation for flights and hotel has been booked.
Total flight price to Honolulu for 2 traveler(s) is $1300.0
Total hotel price for 1 room(s) at Luxury Hotel for 5 night(s) is $998.75
Total package price for flights and hotel is $2298.75

Next Tutorial

In the next tutorial, we will discuss Challenge 3.2, which describes how to do the Trivia Challenge - Audio in Quorum..