kzborisov

TrafficPrice

Sep 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace demo2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double kilometers = double.Parse(Console.ReadLine());
  14. string shift = Console.ReadLine().ToLower();
  15. double price = 0;
  16.  
  17. if (kilometers >= 100)
  18. {
  19. price = kilometers * 0.06;
  20. Console.WriteLine(price);
  21. }
  22. else if (kilometers >= 20)
  23. {
  24. price = kilometers * 0.09;
  25. Console.WriteLine(price);
  26. }
  27. else if (kilometers < 20)
  28. {
  29. if (shift == "day")
  30. {
  31. price = (kilometers * 0.79) + 0.70;
  32. }
  33. else
  34. {
  35. price = (kilometers * 0.90) + 0.70;
  36. }
  37. Console.WriteLine(price);
  38. }
  39. }
  40. }
  41. }
Add Comment
Please, Sign In to add comment