Practice using variables, arithmetic operators, and input to calculate student loan payments.
Create a student loan calculator that helps students understand the cost of borrowing for college:
Enter yearly tuition: 25000
Enter yearly housing: 12000
Total tuition (4 years): $100,000.00
Total housing (4 years): $48,000.00
Total cost: $148,000.00
Federal loan payment: $334.49
Private loan payment: $1,448.95
Total monthly payment: $1,783.44
Where:
Write your student loan calculator below.
If you get the above working, here's a twist. Independent students can take out $57,500 total federal loans. Ask the student if they're independent or dependent and change the formula appropriately.
# Here's some code to help you get started
yearly_tuition = float(input("Enter yearly tuition: "))
yearly_housing = float(input("Enter yearly housing: "))
total_tuition = yearly_tuition * 4
total_housing = yearly_housing * 4
total_cost = total_tuition + total_housing
print(f"Your total cost over 4 years will be ${total_cost})