| | |
C++ Mortgage Calculations Help!!
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jul 2006
Posts: 2
Reputation:
Solved Threads: 0
Hi All,
I'm new to C++ and I have a C++ mortgage assignment due where a user inputs there mortgage amount, interest rate, and term of the loan and the program should give the user there monthly payment and also ask the user if they want to quit or enter a new amount. However, I've been working on this for two days now but I'm having some trouble with my formula everything is compiling but when the user enters there information there monthly payment result is coming out with 1.#INF. I don't know where I'm going wrong so here is a copy of what I have. Any help will be appreciated.
I'm new to C++ and I have a C++ mortgage assignment due where a user inputs there mortgage amount, interest rate, and term of the loan and the program should give the user there monthly payment and also ask the user if they want to quit or enter a new amount. However, I've been working on this for two days now but I'm having some trouble with my formula everything is compiling but when the user enters there information there monthly payment result is coming out with 1.#INF. I don't know where I'm going wrong so here is a copy of what I have. Any help will be appreciated.
//Lakesha Conaler //Week 3 Individual Assignment #include<math.h> #include<iostream> usingnamespace std; int main () { int l = 0; //amount of loan double i = 0; //interest rate int y = 0; // loan term float j = i/(12.0 * 100.0); //Calculates the Interest int m =y*12; //Number of months int quit = 1; // decides if user wants to quit double loanpay; //outputs users loan amount do { cout << "Input the total loan amount:\n"; cin >> l; cout << "Input your interest rate:\n"; cin >> i; cout << "Input your number of years:\n"; cin >> y; j = i/(12.0*100.0); loanpay = (l * i) / (1 - pow((1+i),-m)); cout << "Your monthly payment is: $"<< loanpay<<"\n"; cout << "To Enter a new Loan Amount press 1 or 2 to quit\n"; cin >> quit; } while (quit==1); return 0; }
Last edited by Dave Sinkula; Jul 12th, 2006 at 7:37 pm.
![]() |
Similar Threads
- Mortgage Banker Who Just Moved To Long Island - Looking to link partners (Relevant Link Exchanges)
- Newbie needs help with mortgage program (C++)
- Mortgage Calculations (C++)
- Java Multidimensional Arrays (Java)
- Help with Java code (Java)
- Mortgage Program help (Java)
Other Threads in the C++ Forum
- Previous Thread: Factory Design pattern implementation
- Next Thread: Ask a problem,about inheritance :)
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






