Click here to Skip to main content
15,913,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Question about AfxBeginThread(...) Pin
Ryan Binns13-May-06 22:16
Ryan Binns13-May-06 22:16 
GeneralRe: Question about AfxBeginThread(...) Pin
altfell14-May-06 0:34
altfell14-May-06 0:34 
AnswerRe: Question about AfxBeginThread(...) Pin
Michael Dunn14-May-06 13:08
sitebuilderMichael Dunn14-May-06 13:08 
QuestionpVideo conference Pin
ljeganathan13-May-06 19:33
ljeganathan13-May-06 19:33 
QuestionHow to get deleted files Pin
sp_ranjan13-May-06 10:02
sp_ranjan13-May-06 10:02 
AnswerRe: How to get deleted files Pin
Hamid_RT13-May-06 16:35
Hamid_RT13-May-06 16:35 
GeneralRe: How to get deleted files Pin
sp_ranjan14-May-06 18:22
sp_ranjan14-May-06 18:22 
QuestionMORTGAGE PROGRAM Pin
DARJA- mortgage program13-May-06 9:17
DARJA- mortgage program13-May-06 9:17 
//Modify the mortgage program to input the amount of the mortgage, the term of the mortgage,
//and the interest rate of the mortgage. Display the mortgage payment amount. Allow the user
//to loop back and enter new data or quit. Display and ammortization chart showing the Balance
//and Interest paid monthly. Pause to keep the information from scrolling off of the screen
//Insert thorough comments in the program to document the purpose of the program, the programmer,
//modifications, etc. When displaying money, always include a dollar sign and appropriate decimal
//output.

#include <iostream>
#include <math.h>


using namespace std;

int main() // beginning of main function

{ // starting brackets


//Local Variables

double LoanAmount=0; // shows amount of loan

double InterestRate=0; // rate

int Term=0; // terms of mortgage in months


char quit; //determines if user wants to quit

do


{



//Declare Variables

double InterestRate; // format in decimals
double MonthlyInterestRate; // monthly interest rate
int Months=12; //months in year
int TotalPayment; //number of payment on term
double Payment; //monthly payment amount

int PaymentCounter; // track number of payment


double LoanBalance; //loan balance
double MonthlyIntPymt; //monthly interest paid
double Principal; //principal paid monthly
int DivideList; //partial list
char ListMore; //keep viewing

//cin= provides for input from the terminal (keyboard)
//cout= provides for output to the screen.


cout << "Please enter your Loan Amount: ";
cin >> LoanAmount;

cout << "Enter the Interest Rate: ";
cin >> InterestRate;

cout << "How many years of loan: ";
cin >> Term;



//CALCULATIONS

InterestRate = InterestRate /100; //shows decimal

TotalPayment = Term * Months; //shows number of payments

MonthlyInterestRate=InterestRate / Months; // monthly APR




//CALCULATE MONTHLY AMOUNT

Payment = (LoanAmount*
pow(MonthlyInterestRate + 1, TotalPayment)
* MonthlyInterestRate)/(pow(MonthlyInterestRate + 1,
TotalPayment) - 1);

cout << "" << endl;

//OUTPUT


cout << "What is the Loan Amount: $" << LoanAmount << endl;
cout << "What is the Interest Rate: %" << InterestRate << endl;
cout << "Length of Loan: " << Term << endl;
cout << "Monthly Payment: " << Term << "Years" << endl;

cout << "" << endl;





cout << "Total Payment\tLoan Balance\tInterest Paid" <<;
cout << "" << endl;

//OUTPUT TOTAL PAYMENT, LOAN BALANCE, and INTEREST RATE

for(PaymentCounter=1; PaymentCounter<=TotalPayment; ++ PaymentCounter)

{



MonthlyIntPymt = LoanBalance * MonthlyInterestRate;
Principal = Payment - (LoanBalance * InterestRate);
LoanBalance = LoanBalance - Payment;


//Partial list choose to continue viewing, enter loan amount, or exit


if (DivideList == 12)
{

cout <<"Enter 'c' to continue viewing the list";

<<'L' to enter loan, or 'E' to exit: ";

cin >> ListMore;


if ((ListMore == 'c') || (ListMore == 'C'))
DivideList = 0;

else if ((ListMore == 'l') || (ListMore == 'L'))
break;

else if ((ListMore == 'e') || (ListMore == 'E'))
return 0;
}

//Display outcome of payments

cout<< Payment <<"\t\"
<< LoanBalance <<"\t"
<< MonthlyIntPymt <<"\t\tn";
++DivideList;


}

//Choose to LOOP or QUIT

cout<< "" << endl;
cout<< "Enter C to continue, Q to quit" <<;


cin>> quit;
cout<< "" << end1;

}
while (((quit!= 'q')));


return 0; // Causes the main function to finish

}




I'm having trouble getting my program to compile. I'm using Visual C++ Express Edition
AnswerRe: MORTGAGE PROGRAM Pin
PJ Arends13-May-06 10:08
professionalPJ Arends13-May-06 10:08 
GeneralRe: MORTGAGE PROGRAM Pin
DARJA- mortgage program13-May-06 10:33
DARJA- mortgage program13-May-06 10:33 
QuestionHow to check cell int he MFC Grid Ctrl state when it is checkbox? Pin
mwybranczyk13-May-06 7:40
mwybranczyk13-May-06 7:40 
AnswerRe: How to check cell int he MFC Grid Ctrl state when it is checkbox? Pin
PJ Arends13-May-06 8:44
professionalPJ Arends13-May-06 8:44 
GeneralRe: How to check cell int he MFC Grid Ctrl state when it is checkbox? Pin
mwybranczyk13-May-06 9:23
mwybranczyk13-May-06 9:23 
GeneralRe: How to check cell int he MFC Grid Ctrl state when it is checkbox? Pin
PJ Arends13-May-06 9:55
professionalPJ Arends13-May-06 9:55 
QuestionUsing DrawImage(Image *, 0, 0) - Picture is too big Pin
1980soyo13-May-06 5:34
1980soyo13-May-06 5:34 
AnswerRe: Using DrawImage(Image *, 0, 0) - Picture is too big Pin
PJ Arends13-May-06 8:32
professionalPJ Arends13-May-06 8:32 
GeneralRe: Using DrawImage(Image *, 0, 0) - Picture is too big Pin
1980soyo13-May-06 11:27
1980soyo13-May-06 11:27 
AnswerRe: Using DrawImage(Image *, 0, 0) - Picture is too big Pin
ThatsAlok14-May-06 20:23
ThatsAlok14-May-06 20:23 
AnswerRe: Using DrawImage(Image *, 0, 0) - Picture is too big Pin
Hamid_RT15-May-06 19:17
Hamid_RT15-May-06 19:17 
QuestionMake toolbars undockable Pin
Kleser13-May-06 4:51
Kleser13-May-06 4:51 
AnswerRe: Make toolbars undockable Pin
PJ Arends13-May-06 8:56
professionalPJ Arends13-May-06 8:56 
AnswerRe: Make toolbars undockable Pin
Hamid_RT13-May-06 9:27
Hamid_RT13-May-06 9:27 
AnswerRe: Make toolbars undockable Pin
ThatsAlok14-May-06 22:22
ThatsAlok14-May-06 22:22 
Question2 modems connection Pin
amir hossein malakouti13-May-06 2:36
amir hossein malakouti13-May-06 2:36 
AnswerRe: 2 modems connection Pin
Mohammad Tarik13-May-06 12:55
Mohammad Tarik13-May-06 12:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.