60 696
Assignments Done
97,8%
Successfully Done
In April 2018

# Answer to Question #44783 in C# for Aman Kumar Saini

Question #44783
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.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace maturity_amount
{
&nbsp; &nbsp; class Program
&nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; /// &lt;summary&gt;
&nbsp; &nbsp; &nbsp; &nbsp; /// Main method
&nbsp; &nbsp; &nbsp; &nbsp; /// &lt;/summary&gt;
&nbsp; &nbsp; &nbsp; &nbsp; /// &lt;param name=&quot;args&quot;&gt;&lt;/param&gt;
&nbsp; &nbsp; &nbsp; &nbsp; static void Main(string[] args)
&nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //variable for deposit Amount
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double depositAmount;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //variable for period
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int period;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //variable for maturity Amount
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double maturityAmount=0;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //promt user to enter deposit amount
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.Write(&quot;Enter deposit amount: &quot;);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //read deposit amount
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; depositAmount = double.Parse(Console.ReadLine());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //promt user to enter period of deposit
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.Write(&quot;Enter period of deposit (in year): &quot;);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //read period of deposit
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; period = int.Parse(Console.ReadLine());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maturityAmount = depositAmount;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //calculate maturityAmount
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; period; i++) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maturityAmount += maturityAmount*0.04;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //show result
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.Write(&quot;Maturity amount after the period of deposit: \$&quot; + maturityAmount.ToString());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //delay
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.ReadLine();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!