Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to make a financial calculation of cumulative interest.

For example: a capital of 5000€ over 5 years.

The Math.Pow does not work in this case and I do not understand.

private static void Placement(decimal capital, int duree)
{
    Console.WriteLine("Quel capital souhaitez vous placer en notre institution ?");
    capital = decimal.Parse(Console.ReadLine());
    Console.WriteLine("");

    Console.WriteLine("Chez Trust Invest, le client est Roi et choisit la date précise de son placement en années ?");
    duree = int.Parse(Console.ReadLine());
    Console.WriteLine();

    decimal interet;
    decimal capitalFinal;

    if((capital >= 5000) && (capital <= 10000) && (duree >= 5))
    {
        capitalFinal = capital * Math.Pow((1 + (2/ 100)), duree);
        Console.WriteLine("Pour un capital de entre 5000 et 10000€, il vous est conseillé le plan 
        le plan "Azure" 
" +
        "Celui-ci vous assure un  rendemant de 2% sur 5 ans
" +
        "Simulation : 
");

    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
147 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
...