Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.117.233.52
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/../jdwaltersdorf/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/vnlaughlin/../jdwaltersdorf/assin1.cpp
//
//James Waltersdorf
//Prof. Ames
//

#include <iostream>
#include <iomanip>
using namespace std;

int main ()
{

//	Variables

    int
	loan,		//Amount of loan
	n, 		//months
	k;		//number of payment	    	

    float
	payment,	//payment needed for loan
	i,		//interest rate
	balance;	//the remaining amount to be paid

// 	Input

cout << "Welcome to the Loan Analysis program! ";
cout << "Please enter the Amount of your loan "; 
cin >> loan;
cout << "Now enter your annual interest rate (as a decimal) ";
cin >> i;
cout << "Finally please enter your total number of monthly playments ";
cin >> n;
cout << "To find out what your pending balance to be paid is please enter the number of the payment you are on ";
cin >> k;

//	Processing

payment = ((pow (1 + (i / 12) , n)) / (pow (1 + (i / 12) , n) - 1)) * loan 
* (i / 12);
balance =  payment * ((1 - (pow (1 + (i/12) , k-n))) / (i / 12));

//	Output
cout << fixed;

cout << "\n\n*****************************************";
cout << "\n        Loan Analysis Results            ";
cout << "\n*****************************************";
cout << "\n\n	Annual Interest Rate:		%" << i;
cout << setprecision(2);
cout << "\n	Number of Monthly Payments:	" << n;
cout << "\n	Loan Amount:			$" << loan;
cout << "\n	Monthly Payment:		$" << payment;
cout << "\n	Balance Remaining:		$" << k;
cout << "\n" ;



	return 0;
}

Stv3n404 - 2023