public int Amount;
public int InterestRate;
public int LoanDuration;
public int InterestToBePaid;
public int TotalAmountToBePaid;
public int MonthlyRepayments;
public frmMortgageCalculator()
{
InitializeComponent();
}
private void tabpSimpleInterest_Click(object sender, EventArgs e)
{
}
private void btnCalculate_Click(object sender, EventArgs e)
{
try
{
Amount = int.Parse(txtAmount.Text);
InterestRate = int.Parse(txtInterestRate.Text);
LoanDuration = int.Parse(txtDuration.Text);
//Calculates the interest
InterestToBePaid = InterestRate / 100 * Amount;
lblInterestToBePaid.Text = "The Total Interest You Have To Pay Is:" + InterestToBePaid;
// Calculates the total amount
TotalAmountToBePaid = Amount + InterestRate;
lblTotalAmountToBePaid.Text = "The Total Amount You Have To Pay Is:" + TotalAmountToBePaid;
//Calculates the monthly repayments
MonthlyRepayments = Amount + InterestRate / LoanDuration;
lblMonthlyRepayments.Text = "Your Monthly Repayments Are:" + MonthlyRepayments;
}
catch(Exception exc)
{
MessageBox.Show(exc.Message);
}
VulpesPosted Jan 31, 2014, 10:12 AM
However, as far as the accuracy of the results is concerned, all I can say is that your loan company is going to have a lot of satisfied customers as you're only charging them one month's interest regardless of the term of the loan :)
If level monthly payments of interest and capital are to be made, you really need to use the formula to work out what the amount of the repayment should be. I'd ask your teacher about this formula or check with the other guys in your class to see what they've done.
Umar AnjumPosted Jan 31, 2014, 10:59 AM
VulpesPosted Jan 31, 2014, 10:56 AM
http://www.amazon.co.uk/Java-The-Complete-Reference-Edition/dp/0071606300
Umar AnjumPosted Jan 31, 2014, 10:44 AM
VulpesPosted Jan 31, 2014, 10:39 AM
http://xamarin.com/android
Personally, I'd choose C# over Java every day of the week, but that's just me :)
Umar AnjumPosted Jan 31, 2014, 10:27 AM
VulpesPosted Jan 31, 2014, 10:20 AM
Glad to see that you've a good sense of humor - it's a valuable adjunct to being a programmer!
Umar AnjumPosted Jan 31, 2014, 10:17 AM
Umar AnjumPosted Jan 31, 2014, 9:54 AM
VulpesPosted Jan 31, 2014, 9:42 AM