how to write mathmatical code in c#.Actually i want to calculate the fixed deposite calculation in my project so how could i write the below formulla in c#
A=p(1+r/n)nt,n=4 quaterly,t=no of year
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted May 7, 2013, 12:39 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 6, 2013, 4:43 AM EDT
The output should be 1638.62 of whatever currency you're using.
Bhabani prasad Dash168 reputationPosted May 6, 2013, 9:20 PM EDT
Riddhi ValechaRank #794 · 2.9K reputationPosted May 6, 2013, 11:17 PM EDT
Did not get - plz tell me the calclation of recurring deposite
Bhabani prasad Dash168 reputationPosted May 6, 2013, 11:25 PM EDT
VulpesRank #55 · 29.2K reputationPosted May 7, 2013, 12:10 AM EDT
double M = R * (Math.Pow(1 + i, n) - 1)/ (1 - Math.Pow(1 + i, -1.0/3.0));
Bhabani prasad Dash168 reputationPosted May 7, 2013, 12:28 AM EDT
//txt_insta=installment amount
double R = Double.Parse(txt_installmentamt.Text);
//lbl_rtofint=rate of intrest
double i = (Double.Parse(lbl_rtofintr.Text)/400);
//lbl_tenure=how much time he wiil givemeans for 12 month or 24 etc
int n =int.Parse( lbl_tenure.Text);
double M = R * (Math.Pow(1 + i, n) - 1) / (1 - Math.Pow(1 + i, -1.0 / 3.0));
lbl_returns.Text = M.ToString("#0.00");
lbl_depamt.Text = (Double.Parse(txt_installmentamt.Text) * Double.Parse(lbl_tenure.Text)).ToString("#0.00");
Bhabani prasad Dash168 reputationPosted May 7, 2013, 12:42 AM EDT
Bhabani prasad Dash168 reputationPosted May 7, 2013, 1:05 AM EDT
double i = (Double.Parse(lbl_rtofintr.Text)/400);
//int n =int.Parse( lbl_tenure.Text);
int n = 4;
double M = R * (Math.Pow(1 + i, n) - 1) / (1 - Math.Pow(1 + i, -1.0 / 3.0));
lbl_returns.Text = M.ToString("#0.00");
lbl_depamt.Text = (Double.Parse(txt_installmentamt.Text) * Double.Parse(lbl_tenure.Text)).ToString("#0.00");
i have got the correct answer when am calculate intest on 9% but it fails to give correct answer when am using 18%intrest
VulpesRank #55 · 29.2K reputationPosted May 7, 2013, 1:54 AM EDT
9% = 1259.68
18% = 1321.77
My scientific calculator gives exactly the same results.
The calculator on this site:
http://easycalculation.com/finance/recurring-deposits-maturity-value.php
gives the following answers:
9% = 1257.91
18% = 1321.34
Not quite the same - possibly due to rounding errors.
What do you get?
Bhabani prasad Dash168 reputationPosted May 7, 2013, 2:05 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 7, 2013, 2:14 AM EDT
However, as a general rule, I only answer questions on the forum itself.
Bhabani prasad Dash168 reputationPosted May 7, 2013, 2:20 AM EDT
{
double p = Double.Parse(txt_installmentamt.Text);
double r =(Double.Parse(lbl_rtofintr.Text)/100);
int n = 4; // quarterly
int t =int.Parse(lbl_tenure.Text);
double A = AccumulatedValue(p, r, n, t);
lbl_depamt.Text = (Double.Parse(txt_installmentamt.Text)).ToString("#0.00");
lbl_returns.Text = A.ToString("#0.00");
}
protected double AccumulatedValue(double p, double r, int n, int t)
{
return p * Math.Pow(1 + r / n, n * t);
}
u give me this code and it only working for one year more than one year it show wrong information
plz help me
VulpesRank #55 · 29.2K reputationPosted May 7, 2013, 2:30 AM EDT
My scientific calculator gives exactly the same answer:
1000 x 1.045 ^ 40 = 5816.36
So, I'm sure the program is working correctly.
Bhabani prasad Dash168 reputationPosted May 7, 2013, 2:38 AM EDT