Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 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 ConsoleApp19
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string town = Console.ReadLine().ToLower();
  14. string product = Console.ReadLine().ToLower();
  15. double quantity = double.Parse(Console.ReadLine());
  16.  
  17. if (town=="sofia")
  18. {
  19. if (product=="coffee") Console.WriteLine(0.50 * quantity);
  20. else if (product=="water") Console.WriteLine(0.80 * quantity);
  21. else if (product=="beer") Console.WriteLine(1.20 * quantity);
  22. else if (product== "sweets") Console.WriteLine(1.45 * quantity);
  23. else if (product=="peanuts") Console.WriteLine(1.60 * quantity);
  24.  
  25. }
  26. if (town=="plovdiv")
  27.  
  28. {
  29. if (product == "coffee") Console.WriteLine(0.40 * quantity);
  30. else if (product == "water") Console.WriteLine(0.70 * quantity);
  31. else if (product == "beer") Console.WriteLine(1.15 * quantity);
  32. else if (product == "sweets") Console.WriteLine(1.30 * quantity);
  33. else if (product == "peanuts") Console.WriteLine(1.50 * quantity);
  34. }
  35. if (town=="varna")
  36. {
  37. if (product == "coffee") Console.WriteLine(0.45 * quantity);
  38. else if (product == "water") Console.WriteLine(0.70 * quantity);
  39. else if (product == "beer") Console.WriteLine(1.10 * quantity);
  40. else if (product == "sweets") Console.WriteLine(1.35 * quantity);
  41. else if (product == "peanuts") Console.WriteLine(1.55 * quantity);
  42. }
  43. else { Console.WriteLine("Not valid!"); }
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement