two part question - answered in Python 3 2). Decision Structure: A travel agency is checking whether its tours are good for customers. It follows the table below to label each tour. (e.g., if a tour...




two part question - answered in Python 3 2). Decision Structure: A travel agency is checking whether its tours are good for customers. It follows the table below to label each tour. (e.g., if a tour has 6 destinations and its price is $600, then it should be labelled as ‘expensive’.)



















Number of Destinations



Price



Label




=300



good or expensive



>=5



=500



Good or Expensive



Write a program that asks the user to enter the number of destinations in a tour and the price of this tour. The program should display the label for this tour.   3). Repetition Structure: Note: this question is based on question 2), feel free to add the loops directly into the code for question 2) if you want. a). Add a validation loop for question 2). The validation loop should verify that the user’s input for the number of destinations is a positive number, otherwise it should display an error message and ask for another input. b). Add a loop for question 2) so that the program repeats when the user wants to check another tour. (In other words, the program should ask the user whether he/she wants to check another tour after labeling a tour; if the user answers ‘yes’, the program should again prompt the user to enter the number of destinations and price, and display the corresponding label.) Part 2) and 3) Sample input & output: (Prompt) Enter the number of destinations: (User enter) 3 (Prompt) Enter the price for the tour: (User enter) 500 (Output) The label of this tour is Expensive (Prompt) Do you want to check another tour? Enter yes if you do: (User enter) yes (Prompt) Enter the number of destinations: (User enter) -1 (Output) Please enter a positive number of destinations. (Prompt) Enter the number of destinations: (User enter) 6 (Prompt) Enter the price for the tour: (User enter) 450 (Output) The label of this tour is Good (Prompt) Do you want to check another tour? Enter yes if you do: (User enter) no


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here