DotNet Mirror
  DNM facebook   DNM Google+   DNM Twitter   

Calculate Simple Interest using C#.NET

By Ashok Nalam on 27 Jun 2013 | Category: C# | Tagged: .NET number 
The snippet covers program to Calculate Simple Interest using C#.NET
  Discuss Add Comment   |  
Add rating Rate this resource   

Simple Interest - Quickest method to calculate the interest on a loan. Simple Interest is calculated by multiplying the Interest Rate by the Principal by the Number of Periods.

Formula:

Simple Interest(SI) = P * I * N

P - Loan amount

I - Interest Rate

N - Duration of Loan Period

Program:

namespace DotNetMirror
{
    class SimpleInterestClass
    {
        static void Main()
        {
            double P, R, SI,N, finalAmount;
            Console.Write("Enter Principal(Loan Amount) : ");
            P = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter Time Period(Years) : ");
            N = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter Rate Of Interest(%) : ");
            R = Convert.ToDouble(Console.ReadLine());

            SI = P * N * (R / 100); //formula
            finalAmount = P + SI;

            Console.WriteLine("Interest earned : {0}", SI);
            Console.WriteLine("Final amount after interest : {0}", finalAmount);
            Console.ReadLine();

        }
    }
}

Output:

Enter Principal(Loan Amount) : 2000
Enter Time Period(Years) : 2
Enter Rate Of Interest(%) : 12
Interest earned : 480
Final amount after interest : 2480

Note: Simple Interest does not calculate based on compounding. Interest amount will be always on Principal, so Interest on Interest is not included. Simple Interest will be useful for Short Term periods.

  Discuss Add Comment    
Add rating Rate this resource   
About the Contributor
Member Since : 10 Dec 2012
Member Points (Level) : 8666  (Professional)
Location : INDIA
Home Page : http://dotnetmirror.com
About : I am admin of this site.
Rate this resource
 
Add your Comment
Name Email WebSite
Captcha Refresh


Comments (0)
No comments found, click here to add comment.