Problem 1 · Safety Gate
Equipment Loan Eligibility
Determine if a student may check out lab equipment. Requirements: GPA ≥ 2.5, completed safety
training, and no outstanding fees.
- Read GPA (float), training status (y/n), and outstanding fee amount.
- Use Boolean operators to evaluate the rule.
- Print “Approved” or “Denied” plus a reason.
gpa = float(input("GPA: "))
trained = input("Safety training completed (y/n): ").strip().lower() == 'y'
fees = float(input("Outstanding fees (AED): "))
eligible = gpa >= 2.5 and trained and fees == 0
if eligible:
print("Loan approved – enjoy the equipment!")
else:
print("Loan denied. Please verify GPA, training, and fee status.")
Problem 2 · Parking
Campus Parking Pass Recommender
Create a decision tree that recommends a parking pass type based on commuter category and arrival
time.
- Collect commuter type (faculty, staff, student) and arrival hour (0–23).
- Use nested conditionals for premium vs. standard lots.
- Emit the pass recommendation.
commuter = input("Commuter type (faculty/staff/student): ").strip().lower()
hour = int(input("Arrival hour (0-23): "))
if commuter == "faculty":
ticket = "Faculty Premium"
elif commuter == "staff":
ticket = "Staff Standard" if hour >= 10 else "Staff Priority"
else:
ticket = "Student Evening" if hour >= 15 else "Student Standard"
print("Recommended pass:", ticket)
Problem 3 · Scholarship Review
Scholarship Eligibility Checker
Determine whether a student qualifies for a scholarship based on GPA, completed credit hours, and a
service-learning flag.
- Accept GPA, earned credits, and a yes/no string.
- Use nested conditionals to enforce rules.
- Provide feedback with the failing requirement when rejecting.
gpa = float(input("Current GPA: "))
credits = int(input("Completed credits: "))
service = input("Finished service-learning project (y/n): ").strip().lower() == "y"
if gpa < 3.2:
print("Not eligible: GPA below 3.2")
elif credits < 45:
print("Not eligible: Need at least 45 credits")
elif not service:
print("Not eligible: Service-learning project incomplete")
else:
print("Eligible for scholarship review!")