codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Program help  Tank at 17:44 on Sunday, October 16, 2005
 

I have just created a mortgage calculator and need some help figuring out how to add an amoritization table. Thanks!

Here is my following code in C++:
#include <iostream>
#include <cmath>

#define BUFF_MAX 8192

using namespace std;

//Program functions allow program to calculate input
double CalculatePayment(int TRM, double RTE, double AMT);
bool ValidateDouble(double Input, double Min, double Max);
bool ValidateInt(int Input, int Min, int Max);

int main()

{

int Year = 0;
double Amount = 0.0;
double RateAMT = 0.0;
double MonthlyPayment = 0;
char Continue[BUFF_MAX];

// set cout to appropriate operation
cout.precision(2); // Only display to decimal places
cout.setf(ios::fixed); // Never use scientific notation
cout.setf(ios::showpoint); // Always display decimal portion

do { //loop until user enters 'N' to end the program

//Allows user to input required information
cout << endl;
cout << "Thank you for using our mortgage calculator " << endl;

while ( true ) { //added a while loop - while fail is true
cout << "Please enter the mortgage amount: ";
cin >> Amount;
if ( ( Amount >= 0.005 ) && ( Amount < 10000000.005 ) ) break;
cin.clear(); // clear the error state
cin.ignore(BUFF_MAX, '\n'); // ignore all characters entered
// display error message
cout << "Enter a number between 0.01 and 10000000.00" << endl;
}

cout << "You entered $" << Amount << endl; //if no more errors, display number
while ( true ) { //added a loop to verift that the term etered is correct
cout << "Please enter the term of the loan (in years): ";
cin >> Year;
if ( ( Year >=1 ) && ( Year <50) ) break;
cin.clear(); // clear the error state
cin.ignore(BUFF_MAX, '\n'); // ignore all characters entered
// display error message
cout << "Enter a number between 1 and 50" << endl;
}
cout << "You entered: " << Year << " Years." <<endl;
while ( true ) { //added a loop to verify that the percentage entered is correct
cout << "Please enter the current interest rate percentage: ";
cin >> RateAMT;
if ( ( RateAMT >=0.005) && ( RateAMT <25.00) ) break;
cin.clear(); // clear the error state
cin.ignore(BUFF_MAX, '\n'); // ignore all characters entered
// display error message
cout << "Enter a interest rate between 1 and 25" << endl;
}
cout << "You entered: " << RateAMT << " %." <<endl;
cout <<endl;

// Calculate payment

MonthlyPayment = CalculatePayment(Year, RateAMT, Amount);

//Output of the total monthly payment

cout << "Mortgage Calculation" <<endl;

cout << "Term of the loan: " << Year << " years" << endl;

cout << "Amount of the loan: $" << Amount <<endl;

cout << "Current interest Rate: " << RateAMT << "%" <<endl;

cout << "The monthly payment is: $" << MonthlyPayment << endl;

cout <<endl;

cout << "Please enter Y for to make another calculation or N to end the program: ";

cin >> Continue;

} while ( (Continue[ 0 ] == 'Y') || (Continue[ 0 ] == 'y') );

}

//Calculate payment

double CalculatePayment(int TRM, double RTE, double AMT)

{

double RatePct = RTE / 100;
const int Months = 12;
TRM = TRM * Months;

return (AMT * pow ( ( 1 + ( RatePct / Months ) ),TRM) * (RatePct / Months ) ) /
( pow ( ( 1 + ( RatePct / Months ) ),TRM ) -1);
/* Scaffolding code for testing purposes */
cin.ignore(256, '\n');
cout << "Press ENTER to continue..." << endl;
cin.get();
/* End Scaffolding */
}



  Christian Louboutin  huaxiangseo at 08:05 on Tuesday, November 22, 2011
 

MANCHESTER, N.H. (AP) — [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin[/url] Republican presidential contender Newt Gingrich on Monday proposed allowing younger workers still decades away from retirement to bypass Social Security [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutins[/url] and instead choose private investment accounts that would be subject to [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Sale[/url] stock market gyrations.The former House speaker, who has risen in the polls, would allow younger workers to take [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Shoes[/url] their share of the payroll tax that funds Social Security and put it in a private account.Employers would still [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Cheap[/url] pay their share of the tax, which would be used to pay benefits for current retirees. But it would create [url=http://www.christianlouboutinredbottoms.com/]Cheap Christian Louboutin[/url] a funding shortfall that Gingrich brushed off."That gap is more than covered by the savings" that would come [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Outlet[/url] from giving states control of 185 social welfare programs, Gingrich told reporters after a speech that [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Outlet Store[/url] laid out broad concepts but lacked key details.Gingrich's plan would cover the near-term deficits by giving to [url=http://www.christianlouboutinredbottoms.com/]Discount Christian Louboutin[/url] states responsibility for such programs as AmeriCorps volunteers, Section 8 public housing [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Discount[/url] and Pell Grants for college students.
[url=http://www.christianlouboutinredbottoms.com/]Discount Christian Louboutin Shoes[/url]
[url=http://www.christianlouboutinredbottoms.com/]Cheap Christian Louboutin Shoes[/url]
[url=http://www.christianlouboutinredbottoms.com/new-christian-louboutin-c-20.html]Red Bottoms[/url]
[url=http://www.christianlouboutinredbottoms.com/new-christian-louboutin-c-20.html]Red Bottoms Shoes[/url]
[url=http://www.christianlouboutinredbottoms.com/new-christian-louboutin-c-20.html]Red Bottom[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-boots-c-5.html]Christian Louboutin Boots[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Christian Louboutin Replica[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Replica Christian Louboutin[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Replica Louboutin[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Replica Louboutins[/url]
He said states were better suited to administer those programs.Gingrich [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Online[/url] said his retirement proposal, an idea floated by Republicans before him, would empower voters."Wouldn't you rather control your account?" Gingrich asked an audience of students at St. Anselm College.His advisers couldn't say how much the plan would cost, when it would begin or who would be [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Shop[/url] eligible. They did say, however, that current retirees would continue to receive benefits at promised levels.[url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Store[/url] Peter Ferrara, Gingrich's senior economic policy adviser, said federal spending as a whole would be reduced [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin For Cheap[/url] by half within the next three decades."It's a lot of reduction," he said.At a business leaders' [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin On Sale[/url] breakfast earlier in the day in Nashua, Gingrich predicted that the program "would save literally [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin UK[/url] trillions over the next generation."Under the plan, workers would be able to do one of two things: continue sending [url=http://www.christianlouboutinredbottoms.com/]Louboutin[/url] their share of Social Security taxes to the popular, safety-net program or give it to private firms that would compete for [url=http://www.christianlouboutinredbottoms.com/]Louboutin Sale[/url] those dollars — as much as $20,000 a year, Gingrich estimated."No one is ever forced into the (private account) system," he said after the speech.
Markets would determine how much money workers who chose private [url=http://www.christianlouboutinredbottoms.com/]Louboutin Outlet[/url] accounts would get each month. Gingrich guaranteed a minimum income in case Wall Street collapses like it did in 2008.[url=http://www.christianlouboutinredbottoms.com/]Louboutin Shoes[/url] As Gingrich spoke Monday, stocks plunged several hundred points by midday as a special congressional panel in [url=http://www.christianlouboutinredbottoms.com/]Cheap Louboutin[/url] Washington appeared ready to declare failure in its attempt to agree on how to trim federal spending by $1.2 trillion over a decade.
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Christian Louboutin Knockoffs[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-pumps-c-6.html]Christian Louboutin Pumps[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-wedges-c-2.html]Christian Louboutin Wedges[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-sandals-c-1.html]Christian Louboutin Sandals[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-slingback-c-9.html]Christian Louboutin Slingback[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-bridal-c-10.html]Christian Louboutin Bridal[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-peep-toe-c-7.html]Christian Louboutin Peep Toe[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-sneakers-c-11.html]Christian Louboutin Sneakers[/url]
[url=http://www.christianlouboutinredbottoms.com/]http://www.christianlouboutinredbottoms.com/[/url]

  Christian Louboutin  huaxiangseo at 08:07 on Tuesday, November 22, 2011
 

MANCHESTER, N.H. (AP) — [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin[/url] Republican presidential contender Newt Gingrich on Monday proposed allowing younger workers still decades away from retirement to bypass Social Security [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutins[/url] and instead choose private investment accounts that would be subject to [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Sale[/url] stock market gyrations.The former House speaker, who has risen in the polls, would allow younger workers to take [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Shoes[/url] their share of the payroll tax that funds Social Security and put it in a private account.Employers would still [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Cheap[/url] pay their share of the tax, which would be used to pay benefits for current retirees. But it would create [url=http://www.christianlouboutinredbottoms.com/]Cheap Christian Louboutin[/url] a funding shortfall that Gingrich brushed off."That gap is more than covered by the savings" that would come [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Outlet[/url] from giving states control of 185 social welfare programs, Gingrich told reporters after a speech that [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Outlet Store[/url] laid out broad concepts but lacked key details.Gingrich's plan would cover the near-term deficits by giving to [url=http://www.christianlouboutinredbottoms.com/]Discount Christian Louboutin[/url] states responsibility for such programs as AmeriCorps volunteers, Section 8 public housing [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Discount[/url] and Pell Grants for college students.
[url=http://www.christianlouboutinredbottoms.com/]Discount Christian Louboutin Shoes[/url]
[url=http://www.christianlouboutinredbottoms.com/]Cheap Christian Louboutin Shoes[/url]
[url=http://www.christianlouboutinredbottoms.com/new-christian-louboutin-c-20.html]Red Bottoms[/url]
[url=http://www.christianlouboutinredbottoms.com/new-christian-louboutin-c-20.html]Red Bottoms Shoes[/url]
[url=http://www.christianlouboutinredbottoms.com/new-christian-louboutin-c-20.html]Red Bottom[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-boots-c-5.html]Christian Louboutin Boots[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Christian Louboutin Replica[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Replica Christian Louboutin[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Replica Louboutin[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Replica Louboutins[/url]
He said states were better suited to administer those programs.Gingrich [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Online[/url] said his retirement proposal, an idea floated by Republicans before him, would empower voters."Wouldn't you rather control your account?" Gingrich asked an audience of students at St. Anselm College.His advisers couldn't say how much the plan would cost, when it would begin or who would be [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Shop[/url] eligible. They did say, however, that current retirees would continue to receive benefits at promised levels.[url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin Store[/url] Peter Ferrara, Gingrich's senior economic policy adviser, said federal spending as a whole would be reduced [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin For Cheap[/url] by half within the next three decades."It's a lot of reduction," he said.At a business leaders' [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin On Sale[/url] breakfast earlier in the day in Nashua, Gingrich predicted that the program "would save literally [url=http://www.christianlouboutinredbottoms.com/]Christian Louboutin UK[/url] trillions over the next generation."Under the plan, workers would be able to do one of two things: continue sending [url=http://www.christianlouboutinredbottoms.com/]Louboutin[/url] their share of Social Security taxes to the popular, safety-net program or give it to private firms that would compete for [url=http://www.christianlouboutinredbottoms.com/]Louboutin Sale[/url] those dollars — as much as $20,000 a year, Gingrich estimated."No one is ever forced into the (private account) system," he said after the speech.
Markets would determine how much money workers who chose private [url=http://www.christianlouboutinredbottoms.com/]Louboutin Outlet[/url] accounts would get each month. Gingrich guaranteed a minimum income in case Wall Street collapses like it did in 2008.[url=http://www.christianlouboutinredbottoms.com/]Louboutin Shoes[/url] As Gingrich spoke Monday, stocks plunged several hundred points by midday as a special congressional panel in [url=http://www.christianlouboutinredbottoms.com/]Cheap Louboutin[/url] Washington appeared ready to declare failure in its attempt to agree on how to trim federal spending by $1.2 trillion over a decade.
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-collection-c-18.html]Christian Louboutin Knockoffs[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-pumps-c-6.html]Christian Louboutin Pumps[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-wedges-c-2.html]Christian Louboutin Wedges[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-sandals-c-1.html]Christian Louboutin Sandals[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-slingback-c-9.html]Christian Louboutin Slingback[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-bridal-c-10.html]Christian Louboutin Bridal[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-peep-toe-c-7.html]Christian Louboutin Peep Toe[/url]
[url=http://www.christianlouboutinredbottoms.com/christian-louboutin-sneakers-c-11.html]Christian Louboutin Sneakers[/url]
[url=http://www.christianlouboutinredbottoms.com/]http://www.christianlouboutinredbottoms.com/[/url]








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Christian Louboutin
•  Christian Louboutin
•  Christian Louboutin
•  Christian Louboutin
•  Christian Louboutin
•  Christian Louboutin
•  Re: how to create forum using asp.net with c# language?
•  Re: C++ Beginner question
•  2011 autumn and winter TOUGH Jeansmith new leather ( Figure )Moncler Quincy


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011