Question: Python Help 1. Let's practice using a simple conditional statement! Write a simple bouncer program that will prompt for the user's age, and tell them

Python Help

1. Let's practice using a simple conditional statement! Write a simple "bouncer" program that will prompt for the user's age, and tell them whether they can come into a bar or not, depending on how old they are.

If correctly running, it should look something like this:

Hello, potential customer! How old are you? 21 Come on in!

OR:

Hello, potential customer! How old are you? 19 Sorry, you need to be at least 21 to come in.

2. Let's modify the current program to comply with overtime rules. Let's give the employee 1.5 times the hourly rate for hours worked above 40 hours. Hint: use conditionals!

For example, if the number of hours worked is 45, and the rate of pay is 10, you should get 475.0 (10/hr for 40 hrs, and 15/hr for 5 hrs).

user_input = input("Hello! What is your name:")

print("Hello " + user_input + "! Using this program, we can help you determine your pay for the week!")

hours_worked = int(input("Please enter the hours you worked this week:"))

#Ask the user for the rate of pay following the same format from the output above rate_of_pay = int(input("Next, please enter your rate of pay:"))

#Create a variable that multiplies the hours_worked and the rate_of_pay pay_for_week= str (hours_worked * rate_of_pay)

#Write a print statement that will output the last line of the output provided print("Calculating...you will make $" + pay_for_week + " by the end of the week!")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!