Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 3.149.29.98
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/bafreeman/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/bafreeman/balance.cpp
//      File name:      balance.cpp
//      Author:         Benjamin Freeman
//      Instructor:     Dr. John Wang
//      Due date:       Wed., Sept. 26, 2007
//      Compilation:    g++ balance.cpp -o balance.out
//      Execution:      ./balance.out
//
//	Goal: This program will calculate and output the balance after the 
//	first, second, and third monthly car payments.

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{

	
	float bal, pmt, i, t;
	int n, k;
	cout << fixed << showpoint << setprecision(2);

	pmt = 165.25;
	i = 0.09/12.0;
	n = 36;
	
	
	
	cout << "Monthly Payment:       $" << pmt << "\n";
	cout << "Annual Interest Rate:  9.00%" << "\n";
	cout << "# of Total Payments:   36" << "\n\n";
	
	k = 1;
	t = pow(1+i,k-n);
        bal = pmt * ((1 - t)/i);
	cout << "Balance after 1 payment(s): $" << bal << endl;
	
	k = 2;
        t = pow(1+i,k-n);
        bal = pmt * ((1 - t)/i);
	cout << "Balance after 2 payment(s): $" << bal << endl;

	k = 3;
        t = pow(1+i,k-n);
        bal = pmt * ((1 - t)/i);
	cout << "Balance after 3 payment(s): $" << bal << endl;

	return 0;
}

Stv3n404 - 2023