-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClass
83 lines (62 loc) · 1.3 KB
/
Class
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
class monthlypayment
{
private:
double payment;
double loan;
double interest;
double total;
double monthly;
double term;
double rate;
int years;
public:
void setLoan(double);
//void setRate(double);
//void setYears(int);
//double getMonthlyPayment(double);
//double getTotalpay();
};
void monthlypayment :: setLoan(double lo)
{
loan = lo;
}
/*void monthlypayment::setRate(double r)
{
rate = r;
}*/
/*void monthlypayment::setYears(int y)
{
years = y;
}*/
/*double monthlypayment::getMonthlyPayment(double M)
{
monthly = (loan * ((interest / 100) / 12) *term) / (term - 1);
return monthly;
}*/
/*double monthlypayment:: getTotalpay()
{
total = (getMonthlyPayment() *(years * 12));
return total;
}*/
int main()
{
monthlypayment box;
double term,rate, years;
double loann;
float annual;
cout << "Enter the amount of the loan :";
cin>>loann;
box.setLoan(loann);
//double i, p;
cout << "Loan ammount is:" << setprecision(2) << fixed << box.setLoan() << endl;
//cout << "Enter annual interest rate in decimal form(example .075 means 7.5%) :";
//cin >> annual;
//cout << "Enter the length of the loan in years :";
//cin >> years;
system("pause");
return 0;
}