# Problem 1: Eligibility to Vote
is_citizen = input("Are you a citizen? (yes/no): ").lower() == "yes"
age = int(input("Enter your age: "))
if is_citizen and age >= 18:
print("You are eligible to vote!")
else:
print("You are not eligible to vote.")
# Problem 2: Employee Bonus Calculation
years_of_service = int(input("Enter your years of service: "))
salary = float(input("Enter your salary: "))
if years_of_service > 5:
bonus_percentage = 5
bonus_amount = (bonus_percentage / 100) * salary
print(f"Congratulations! You have earned a {bonus_percentage}% bonus of ${bonus_amount:.2f}.")
else:
print("Sorry, you are not eligible for a bonus.")
# Problem 3: Grading System
marks = int(input("Enter your marks: "))
if marks < 25:
grade = "F"
elif marks <= 45:
grade = "E"
elif marks <= 50:
grade = "D"
elif marks <= 60:
grade = "C"
elif marks <= 80:
grade = "B"
else:
grade = "A"
print(f"Your grade is: {grade}")
P1 Boolean and Conditionals HW • 2 min read
Description
Period 1 Boolean Homework