Advertisement
AngelVasilev

Untitled

Dec 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace rent
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int months = int.Parse(Console.ReadLine());
  10. int percentComission = int.Parse(Console.ReadLine());
  11. double rentPerMonth = double.Parse(Console.ReadLine());
  12.  
  13. double rentForSecondHalf = rentPerMonth * 0.80;
  14. double monthFirsHalf = months / 2;
  15. double sum = (monthFirsHalf * rentPerMonth) + (rentForSecondHalf * monthFirsHalf);
  16. double comission = sum * percentComission / 100;
  17. double total = comission + sum;
  18.  
  19.  
  20. Console.WriteLine($"Total: {total:f2}");
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement