BSO90

Interest

Apr 27th, 2021 (edited)
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _7.Interest
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             decimal deposit = decimal.Parse(Console.ReadLine());
  10.             decimal firstYearDeposit = deposit + deposit * 0.05m;
  11.             decimal secondYearDeposit = firstYearDeposit + firstYearDeposit * 0.05m;
  12.             decimal thirdYearDeposit = secondYearDeposit + secondYearDeposit * 0.05m;
  13.             Console.WriteLine($"{firstYearDeposit:f2}\n{secondYearDeposit:f2}\n{thirdYearDeposit:f2}\n");
  14.         }
  15.     }
  16. }
  17.  
Add Comment
Please, Sign In to add comment