Devin Dahlberg

Python: Assignment Two

#A middle school has 24 students who need a ride for a field trip. The program should ask how many parents/guardians are available to give the students a ride.
#You can assume that each parent/guardian can give a ride to 4 students. The program should output how many students do not have a ride.
#Use if statement to print out a statement whether "all the students have a ride" or "some students do not have a ride."

#Determine how many parents/guardians are available to give the students a ride.
available = int(input('How many parents/guardians are available to give the students a ride? '))

#Determine how many students do not have a ride.
rideless = available * 4

#Display the amount of students without a ride.
if rideless >= 24:
    print("All the students have a ride.")

else:
    print("Some students do not have a ride.")

HW3P1

#The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year: 6/10/60.
#Design a program that asks the user to enter a month (in numeric form), a day, and a two-digit year.
#The program should then determine whether the month times the day equals the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic.

#Prompt user to enter a date in numeric form.
month = int(input('Enter a month in numeric form: '))
day = int(input('Enter a day: '))
year = int(input('Enter a two-digit year: '))

#Determine whether the date is magic
if year == month * day:
    print("This date is magic.")
else:
    print("This date is not magic.")

HW3P2