0% found this document useful (0 votes)
7 views1 page

Homework Drop Off

Uploaded by

Kiana Vahedinia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Homework Drop Off

Uploaded by

Kiana Vahedinia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#1

c = int(input("Enter the number of credits you have: "))


v = int(input("Enter the number of volunteer hours you have: "))

if c < 0 or v < 0:
print("Invalid input: credits and volunteer hours cannot be negative.")
elif c >= 30 and v >= 40:
print("Congratulations! You are eligible to graduate.")
else:
print("You are not eligible to graduate yet. You need at least 30 credits and
40 volunteer hours.")

#2
day_of_week = int(input("Enter the day of the week (0 = Sunday, 1 = Monday, etc.):
"))
on_vacation = int(input("Are you on vacation? (0 = No, 1 = Yes): "))
if day_of_week < 0 or day_of_week > 6:
print("Invalid input: day of the week must be between 0 and 6.")
elif on_vacation < 0 or on_vacation > 1:
print("Invalid input: vacation status must be 0 (No) or 1 (Yes).")
else:
is_weekday = 1 <= day_of_week <= 5
if not on_vacation and is_weekday:
alarm_time = "7:00 a.m."
elif not on_vacation and not is_weekday:
alarm_time = "10:00 a.m."
elif on_vacation and is_weekday:
alarm_time = "10:00 a.m."
else:
alarm_time = "OFF"
print("\nALARM:")
print(alarm_time)

#3
age = int(input("Please enter your age: "))
show_time = int(input("Please enter show time (in 24-hour format): "))
if age < 0 or show_time < 0 or show_time > 2359:
print("Invalid input: Age and show time must be positive, and show time must be
in 24-hour format.")
else:
if age > 13:
if show_time < 1800:
price = "$5.00"
elif show_time >= 2200:
price = "$4.00"
else:
price = "$8.00"
else:
if show_time >= 2200:
print("Midnight Madness is not available for children under 14 years
old!")
elif show_time < 1800:
price = "$2.00"
else:
price = "$4.00"
if show_time < 2200:
print(f"The ticket price is {price}!")

You might also like