Server IP : 172.16.15.8 / Your IP : 3.144.89.152 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/vnlaughlin/../arpease/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
# include <iostream> # include <cmath> using namespace std; int main() { float loanAmount;// the loan amount float interest;// the interest rate float interest1; float monthPay;// how many months float payment;// the amount to be paid float temp;// temperary cout << "Welcome to The Loan Analysis Program! \n"; cout << "Please enter the loan amount, the maximum amount is 500,000\n"; cin >> loanAmount; // pass in the amount of the loan cout << "Enter the annual interest rate as a decimal:\n"; cin >> interest; // pass in the amount of interest cout << "Enter the number of monthly payments: "; cin >> monthPay; // how many months your going to be paying over interest1= interest*100; // mods the interest, put it into another variable cout << " \n\n\n\n Loan Summary "; cout << "\n\n\n\nAnnual Interest Rate: "<<interest1<< "\nNumber of Monthly Payments " << monthPay << "\n\n"; cout << "Your Loan amount is " << loanAmount;// Payment math float temp3;// used to divide the bottom of the payment variable // First equation blow to find the payment temp= pow((1+(interest/12)), monthPay)*loanAmount; payment= temp*(interest/12); temp3= pow((1+(interest/12)),monthPay)-1; payment=payment/temp3; // Second equation below cout << "\nYour monthly payment is: $ "<< payment; float k; // the exponent float balance;// Halway Through k=monthPay/2; float n= k-monthPay; balance=payment*( 1-(pow ((1+(interest/12)),n))/(interest/12)); float balance2;// the new balance cout << "\nHalfway though your balance is: $" << balance; payment=monthPay*payment; payment=payment-loanAmount; cout << "\nYour total interest paid is: $ " << payment; return 0; }