Question: Create a program named Your last name Vacation Python Create the following def functions: setVacationPackage You will create a vacationList[] with the

Create a program named "Your last name Vacation Python" 

Create the following def functions:

 

setVacationPackage

     You will create a vacationList[] with the following vacation information.

          Hawaii – 7 days / 6 nights                    New York – 3 days / 2 nights        

          The Bahamas – 7 days / 6 nights         Orlando – 5 days / 4 nights

          Los Angeles – 4 days / 3 nights

     Use a While True loop to prompt the user to input a number between 1 and 5  

            Display an error message if the choice is not between 1 and 5            

      Use if...elif statements to determine which vacation was chosen.

     Return the vacation                  

 

setDepartDay

      Prompt the user to input a departure date

     Return the departure date

 

setGuestList

      Create a guestList = []

      Prompt the user to input how many people traveling

     Use a for loop in the range of the number of people

          Enter the first name, last name, and birthdate

          Assign guestList = [first, last, and birthdate]

          Call the setReservationList function passing the guestList

 

setReservationList(guestList)

     Open the text file

     Write the guestList and a new line to the text file

     Close the text file

 

getReservationList

     Create a reservationList[]

     Open the text file

     Read each line

     Strip and split the line

     Append each line to the reservationList

     Close the text file

     Return the reservationList

main

     Call the setVacationPackage function and assign to a vacation variable

     Call the setDepartDay function and assign to a depart variable

     Call the setGuestList function and assign to a guest variable    

     Display a message that tells the user about the vacation chosen

     Display a message about the departure date

     Display a message about the guest reservation list

     Use a for loop in the range of the length of the reservationList

          Print the reservationList index of the list

 

The final output should be something like the following format:

 

Congratulations! You and your family are going to “location chosen”

Your departure date is “date”

Reservations have been made for the following guests:

Frank           Last Name          Birthdate

“                   “                            “

“                   “                            “

“                   “                            “

 

“ are values for those entries, not “

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

python def setVacationPackage vacationList name Hawaii days ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!