Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. people = int(intput(How many people are going to the theme park? )) days = int(intput (For how many days will you be visiting the

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. people = int(intput("How many people are going to the theme park? ")) days = int(intput ("For how many days will you be visiting the park? ")) if days =1 : price_per_day =4 elif days =2 : price_per_day =35 else: price_per_day =30 total_price = people price_per_day days print("price per day: $+ str(price_per_day)) print("Total for your trip: $ " + str(total_price)) \begin{tabular}{ll} 13 & print \\ 14 & \\ 100% & (14:1) \\ \hline \end{tabular} Terminal * Your Codio Box domain is: matchcadet-chariotinvest. codio.io Last login: Sun Jan 29 19:02:24 2023 from 192.168.10.93 codio@matchcadet-chariotinvest: //workspace\$ python3 Content/error4.py Traceback (most recent call last): File "Content/error4.py", line 1 , in smodules people = int(intput ("How many people are going to the theme park? ")) NameError: name 'intput' is not defined codio@matchcadet-chariotinvest: /workspace $ python 3 Content/error 4 .py Traceback (most recent call last): File "Content/error4.py", line 1, in people = int(intput("How many people are going to the theme park? ")) NameError: name 'intput' is not defined codioematchcadet-chariotinvest: / /workspace\$ python3 Content/error4.py Traceback (most recent call last): File "Content/error 4.py", line 1, in module> people = int(intput("How many people are going to the theme park? ")) VameError: name 'intput' is not defined codio@matchcadet-chariotinvest: //workspace\$ Exercise 4: Fix the Errors The program below has 3 errors in it. Fix this program so that it runs without errors. When running it will ask the user how many people are going to a theme park and for how many days. The program will then determine the total amount for the trip. There is a discount when the trip is planned over many days. For instance the price for 1 day is $40 per day. For 2 days the price per day is $35. If the user wants to spend 3 days in the park the price is $25 per day. Given the user has 4 people in their party and will be in the park 2 days. the program should print the following: output: Traceback (most recent call last): File "Content/error4.py", line 1 , in module> people = int (intput ("How many people are going to the theme park? ")) NameError: name 'intput' is not defined Expected: Enter the number of days you will be in the park: Enter the number of people in your party: Price per day: \$35 Total for your trip: $280 Feedback: Make sure you have identified and fixed all 3 errors. Check 2 failed Output: Traceback (most recent call last): File "Content/error4.py", line 1 , in smodules people = int(intput ("How many people are going to the theme park? ")) Nameerror: name 'intput' is not defined Expected: Enter the number of days you will be in the park: Enter the number of people in your party: Price per day: $4e Total for your trip: $200 Codio will test your program using 4 people and 2 days. The second test will use different data. The program below has 3 errors in it. Fix this program so that it runs without errors. When running it will ask the user how many people are going to a theme park and for how many days. The program will then determine the total amount for the trip. There is a discount when the trip is planned over many days. For instance the price for 1 day is $40 per day. For 2 days the price per day is $35. If the user wants to spend 3 days in the park the price is per day. Given the user has 4 people in their party and will be in the park 2 days, the program should print the following: Price per day: \$35 Total for your trip: $280 Codio will test your program using 4 people and 2 days. The second test will use different data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

MFDBS 89 2nd Symposium On Mathematical Fundamentals Of Database Systems Visegrad Hungary June 26 30 1989 Proceedings

Authors: Janos Demetrovics ,Bernhard Thalheim

1989th Edition

3540512519, 978-3540512516

More Books

Students also viewed these Databases questions

Question

Describe the five major steps in conducting JAD sessions.

Answered: 1 week ago