Zhaniartt

Untitled

Oct 29th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 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 New_home
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string flower = Console.ReadLine();
  14. int broy = int.Parse(Console.ReadLine());
  15. int budget = int.Parse(Console.ReadLine());
  16. double cena = 0;
  17. double cenarozi = broy * 5.0;
  18. double cenadalii = broy * 3.80;
  19. double cenalaleta = broy * 2.80;
  20. double cenanarcisi = broy * 3.0;
  21. double cenagladioli = broy * 2.50;
  22. if (flower == "Roses")
  23. {
  24. if (broy > 80) cena = cenarozi - (cenarozi * 0.10);
  25. else cena = cenarozi;
  26. }
  27. else if ( flower =="Dahlias")
  28. {
  29. if (broy > 90) cena = cenadalii - (cenadalii * 0.15);
  30. else cena = cenadalii;
  31. }
  32. else if ( flower == "Tulips")
  33. {
  34. if (broy > 80) cena = cenalaleta - ( cenalaleta * 0.15);
  35. else cena = cenalaleta;
  36. }
  37. else if (flower == "Narcissus")
  38. {
  39. if (broy < 120) cena = cenanarcisi * 1.15;
  40. else cena = cenanarcisi;
  41. }
  42. else if (flower =="Gladiolus")
  43. {
  44. if (broy < 80) cena = cenagladioli * 1.20;
  45. else cena = cenagladioli;
  46. }
  47. double ostatuk = budget - cena;
  48. double nedostig = cena - budget;
  49. if ( cena <= budget) Console.WriteLine($"Hey, you have a great garden with {broy} {flower} and {ostatuk:F2} leva left.");
  50. else Console.WriteLine($"Not enough money, you need {nedostig:F2} leva more.");
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment