spasnikolov131

Untitled

May 13th, 2021
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Fuel_Tank___Part_2
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double benzin = 2.22;
  10. double dizel = 2.33;
  11. double gaz = 0.93;
  12. double discountBenzin = 0.18;
  13. double discountDizel = 0.12;
  14. double discountGaz = 0.08;
  15. string fuel = Console.ReadLine();
  16. double liters = double.Parse(Console.ReadLine());
  17. string clubCard = Console.ReadLine();
  18.  
  19. bool clubCardd = true;
  20. if (fuel == "Gas")
  21. {
  22. if (clubCardd)
  23. {
  24. double price = gaz - discountGaz;
  25. double totalPrice = price * liters;
  26. double endPrice = totalPrice - (0.1 * totalPrice);
  27. Console.WriteLine($"{endPrice:f2} lv.");
  28. }
  29. }
  30.  
  31. else if (fuel == "Gasoline")
  32. {
  33. double totalPrice = liters * benzin;
  34. double endPrice = totalPrice - (0.08 * totalPrice);
  35. Console.WriteLine($"{endPrice:f2} lv.");
  36. }
  37. else if (fuel == "Diesel")
  38. {
  39. double totalPrice = liters * dizel;
  40. Console.WriteLine($"{totalPrice:f2} lv.");
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment