Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Banking_Percent
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите строку вида (исходная сумма процентная ставка срок вклада)");
- string consoleInput = Console.ReadLine();
- Console.WriteLine(Calculate(consoleInput));
- }
- public static double Calculate(string userInput)
- {
- List<string> bankingItems = new List<string>(
- userInput.Split(new string[] { " " }, StringSplitOptions.None));
- double originMoney = Convert.ToDouble(bankingItems[0]);
- double durationMonths = Convert.ToDouble(bankingItems[1]);
- double yearRate = Convert.ToDouble(bankingItems[2]);
- //double monthRate = yearRate / 12.0;
- return originMoney * Math.Pow(1 + yearRate / (12 * 100), durationMonths);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement