diff --git a/bigos/20241001Lecture/Auto01.py b/bigos/20241001Lecture/Auto01.py new file mode 100644 index 0000000..d296d75 --- /dev/null +++ b/bigos/20241001Lecture/Auto01.py @@ -0,0 +1,29 @@ +# Program to calculate the payments on an auto loan + +message=''' +A = Monthly Payment +P = Principal +r = int rate per month +n = number of months + + +Problem +========= +P = 15090 +Term = 4 years = 48 months +Int rate = 7%/year + +Expect 361.07 +''' + +P = input("Enter the principal for the loan ") +P = float(P) + + +n = 48 +r = .07/12 + +A = P * (r*(1+r)**n)/((1+r)**n - 1) + +print("Monthly Payment = ",A) + diff --git a/bigos/20241001Lecture/Support/How to Calculate Auto Loan Payments (with Pictures) - wikiHow.pdf b/bigos/20241001Lecture/Support/How to Calculate Auto Loan Payments (with Pictures) - wikiHow.pdf new file mode 100644 index 0000000..babbb4c Binary files /dev/null and b/bigos/20241001Lecture/Support/How to Calculate Auto Loan Payments (with Pictures) - wikiHow.pdf differ diff --git a/bigos/20241001Lecture/auto02.py b/bigos/20241001Lecture/auto02.py new file mode 100644 index 0000000..e692dac --- /dev/null +++ b/bigos/20241001Lecture/auto02.py @@ -0,0 +1,39 @@ +# Program to calculate the payments on an auto loan + +message=''' +A = Monthly Payment +P = Principal +r = int rate per month +n = number of months + + +Problem +========= +P = 15090 +Term = 4 years = 48 months +Int rate = 7%/year + +Expect 361.07 +''' + +P = input("Enter the principal for the loan ") +P = float(P) + +loanTermYears = input("Enter the number of years for the loan ") +loanTermYears = float(loanTermYears) + +interestRatePerYear = input("Enter the annual interest rate for the loan ") +interestRatePerYear = float(interestRatePerYear)/100 + +print(P,loanTermYears,interestRatePerYear) + +n = loanTermYears * 12 + +r = interestRatePerYear / 12 + +print(n,r) + +A = P * (r*(1+r)**n)/((1+r)**n - 1) + +print("Monthly Payment = ",A) + diff --git a/bigos/20241001Lecture/auto03.py b/bigos/20241001Lecture/auto03.py new file mode 100644 index 0000000..8258cf9 --- /dev/null +++ b/bigos/20241001Lecture/auto03.py @@ -0,0 +1,39 @@ +# Program to calculate the payments on an auto loan + +message=''' +A = Monthly Payment +P = Principal +r = int rate per month +n = number of months + + +Problem +========= +P = 15090 +Term = 4 years = 48 months +Int rate = 7%/year + +Expect 361.07 +''' + +principal = input("Enter the principal for the loan ") +principal = float(principal) + +loanTermYears = input("Enter the number of years for the loan ") +loanTermYears = float(loanTermYears) + +interestRatePerYear = input("Enter the annual interest rate for the loan ") +interestRatePerYear = float(interestRatePerYear)/100 + +#print(principal,loanTermYears,interestRatePerYear) + +loanTermMonthly = loanTermYears * 12 + +interestRateMonthly = interestRatePerYear / 12 + +#print(loanTermMonthly,interestRateMonthly) + +monthlyPayment = principal * (interestRateMonthly*(1+interestRateMonthly)**loanTermMonthly)/((1+interestRateMonthly)**loanTermMonthly - 1) + +print("Monthly Payment = ",monthlyPayment) + diff --git a/bigos/20241001Lecture/links.txt b/bigos/20241001Lecture/links.txt new file mode 100644 index 0000000..4f88fa3 --- /dev/null +++ b/bigos/20241001Lecture/links.txt @@ -0,0 +1,18 @@ +https://www.wikihow.com/Calculate-Auto-Loan-Payments + +A = P * (r(1+r)**n)/(1+r)**n - 1) + +A = Monthly Payment +P = Principal +r = int rate per month +n = number of months + + +Problem +========= +P = 15090 +Term = 4 years = 48 months +Int rate = 7%/year + +Expect 361.07 +