Problem 1 · Semester Budget
Housing & Living Costs Calculator
Prompt for monthly rent, utilities, and food costs, then calculate monthly and semester totals (use 5
months). All numbers should render with two decimals.
- Collect three
float values.
- Compute monthly and semester totals in variables.
- Print both totals with currency formatting.
rent = float(input("Monthly rent (AED): "))
utilities = float(input("Monthly utilities (AED): "))
food = float(input("Monthly food budget (AED): "))
monthly_total = rent + utilities + food
semester_total = monthly_total * 5
print(f"Monthly total: {monthly_total:.2f} AED")
print(f"Semester total: {semester_total:.2f} AED")
Problem 2 · Sensor Snapshot
Greenhouse Temperature Reporter
Read minimum, maximum, and target temperature settings for a controlled greenhouse. Display a summary
line that shows the range and whether the target is centered.
- Read integer inputs for
min_temp, max_temp, target_temp.
- Compute the midpoint and difference between target and midpoint.
- Print a structured report.
min_temp = int(input("Minimum °C: "))
max_temp = int(input("Maximum °C: "))
target_temp = int(input("Target °C: "))
midpoint = (min_temp + max_temp) / 2
offset = target_temp - midpoint
print(f"Range: {min_temp}°C - {max_temp}°C")
print(f"Target {target_temp}°C is {offset:+.1f}°C from midpoint ({midpoint:.1f}°C)")
Problem 3 · Utility Monitor
Energy Cost Estimator
Collect appliance wattage and daily usage hours, then estimate the monthly cost using a fixed price
per kilowatt-hour.
- Prompt for wattage and daily hours.
- Convert watts to kilowatts and multiply by hours × 30 days.
- Apply the tariff and print the total.
watts = float(input("Appliance wattage: "))
hours = float(input("Daily usage hours: "))
tariff = 0.32 # AED per kWh
kilowatts = watts / 1000
monthly_kwh = kilowatts * hours * 30
cost = monthly_kwh * tariff
print(f"Estimated monthly cost: {cost:.2f} AED")