0% found this document useful (0 votes)
14 views1 page

Public Double Int Int Double Double Int Int Return: Math Convert

This document contains code for 3 methods to calculate compound interest, interest earned, and equated monthly installment (EMI). The CompoundInterest method calculates interest earned on a principal amount over a number of years at a given interest rate. The EMI method calculates the monthly payment amount to pay off a loan of a given amount over a number of years at a given interest rate.

Uploaded by

suganya004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Public Double Int Int Double Double Int Int Return: Math Convert

This document contains code for 3 methods to calculate compound interest, interest earned, and equated monthly installment (EMI). The CompoundInterest method calculates interest earned on a principal amount over a number of years at a given interest rate. The EMI method calculates the monthly payment amount to pay off a loan of a given amount over a number of years at a given interest rate.

Uploaded by

suganya004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

public double CompoundInterest(int Amount, int Nyear, double IRate)

{
double temp = Math.Pow((1 + IRate / 12), Nyear);
int temp1=Convert.ToInt16 (Amount * temp);
int temp2 = temp1 - Amount;
return temp2;
}

public int CompoundInterest(int Amount, int Nyear, double IRate)


{
double temp = Math.Pow((1 + IRate / 12), Nyear);
int temp1 = Convert.ToInt16(Amount * temp);
int temp2 = temp1 - Amount;
return temp2;
}
public int EMI(int Amount, int Nyear, double IRate)
{
double temp1 = Amount * (IRate / 12);
double temp2 = (1 + (IRate / 12));
int months = Nyear * 12;
double temp3 = Math.Pow(temp2, months);
int ans=(Convert.ToInt16((temp1 * temp3) / (temp3 - 1)));
return ans;
}

You might also like