Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exerricsee
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. double months = int.Parse(Console.ReadLine());
  11. double percent = int.Parse(Console.ReadLine());
  12. double rent = double.Parse(Console.ReadLine());
  13.  
  14. double firstPeriod = months / 2;
  15. double secondPeriod = months - firstPeriod;
  16.  
  17. double firstPeriodPrice = firstPeriod * rent;
  18. double secondPeriodPrice = secondPeriod * (rent * 0.80);
  19.  
  20. double price = firstPeriodPrice + secondPeriodPrice;
  21. double broker = price * (percent / 100);
  22.  
  23. double totalPrice = price + broker;
  24.  
  25. Console.WriteLine($"Total: {totalPrice:f2}");
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement