My Code:
#include <iomanip>
#include <iostream>
using namespace std;
#include <cmath>
int main()
{
double years = 30;
double M;
cout << "What's the mortgage amount? ";
cin >> M;
cin.ignore(1000, 10);
double I;
cout << "What's the annual interest rate? ";
cin >> I;
cin.ignore(1000, 10);
double A = I/12;
double T = years * 3;
double prob1 = (M*(1+I)T*I);
double prob2 = ((1+I)T-1);
double W = prob1/prob2;
cout << fixed;
cout << "its " << W << endl;
return 0;
}
MOD EDIT: When posting code...USE CODE TAGS!!!
This post has been edited by JackOfAllTrades: 11 March 2011 - 06:01 AM

New Topic/Question
Reply



MultiQuote


|