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);
}

VulpesRank #55 · 29.2K reputationPosted Jan 31, 2014, 5:12 AM EST
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.
VulpesRank #55 · 29.2K reputationPosted Jan 31, 2014, 4:42 AM EST
Umar Anjum41 reputationPosted Jan 31, 2014, 4:54 AM EST
Umar Anjum41 reputationPosted Jan 31, 2014, 5:17 AM EST
VulpesRank #55 · 29.2K reputationPosted Jan 31, 2014, 5:20 AM EST
Glad to see that you've a good sense of humor - it's a valuable adjunct to being a programmer!
Umar Anjum41 reputationPosted Jan 31, 2014, 5:27 AM EST
VulpesRank #55 · 29.2K reputationPosted Jan 31, 2014, 5:39 AM EST
http://xamarin.com/android
Personally, I'd choose C# over Java every day of the week, but that's just me :)
Umar Anjum41 reputationPosted Jan 31, 2014, 5:44 AM EST
VulpesRank #55 · 29.2K reputationPosted Jan 31, 2014, 5:56 AM EST
http://www.amazon.co.uk/Java-The-Complete-Reference-Edition/dp/0071606300
Umar Anjum41 reputationPosted Jan 31, 2014, 5:59 AM EST