Develop a program that accepts a deposit amount and period of deposit. Calculate the maturity amount after the period of deposit. The bank pays 4% interest per year for any deposits made in the bank.
1
Expert's answer
2015-06-11T02:11:17-0400
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace ConsoleApplication2 { class A { public double maturity_amount(double amount,double period) { double maturity_amount = amount * (1.0 + (period / 12.0) * 0.04); return maturity_amount;
} } class Program { static void Main(string[] args) { double amount,period; A ob = new A(); Console.WriteLine("Enter a deposit amount: "); amount = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Enter a period of deposit (in mounth): "); period = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("The maturity amount after the period ("+period+") of deposit is " + ob.maturity_amount(amount,period)); Console.ReadLine();
Comments
Leave a comment