Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Description Create a Python program which implements a travel agent bot. The bot will first display a welcome message. Then it will ask for

Problem Description

Create a Python program which implements a travel agent bot.

The bot will first display a welcome message. Then it will ask for the users name and age. If the user is 65 or older, it will inform them about a senior discount. Next, it asks how long (how many nights) the trip will take. Then it asks whether the user is interested in culture, classical music, or beaches and surfing. Based on the users replies, it will suggest and display the costs of one of two trips the travel agency currently offers or say that they do not have any offers matching the users preferences.

The bot should then ask the user whether they are interested (even if no offer was shown). If that is the case, the bot will provide a one-time password for the user to enter on the travel agency website. If the user is not interested, the bot will say goodbye. Then the program will end. The program must be run several times to have different users interact with this bot. Analyze the Sample runs provided below to understand further how the bot works.

Senior Discount

The senior discount applies to anyone 65 years or older. Every year over 64 gives a discount of 1% (e.g., a user of 70 years would get a discount of 6%).

Trips

The travel agency currently offers two trips. One is to Vienna, where the flight costs 997.93$, and the hotel is 143.84$ per night. The other trip is to Bali, where the flight is 849.93$, and the hotel costs 235.35$ per night.

Rules for Suggesting a Trip

The bot will suggest a trip to Vienna if the user prefers culture over beaches. The bot will suggest a trip to Bali if they prefer beaches over culture. If they like both, the bot will try to maximize the travel agencys profit by recommending whatever trip has the highest total costs (if both cost the same, Bali is chosen).

Password Generation

The one-time password will have the last letter of the users name repeated n times (lower or upper case, same as originally typed), where n is the remainder of dividing the age by 8. Then the password will continue with the first letter in the name (once), and then the password will have a random number (between 0 and 5) of exclamation signs (!).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions