Advertisement
silvana1303

flowers

Mar 25th, 2020
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.61 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. namespace silvanadoc
  7. {
  8.     class silvanadoc
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             var chrysQuant = int.Parse(Console.ReadLine());
  13.             var roseQuant = int.Parse(Console.ReadLine());
  14.             var tulipQuant = int.Parse(Console.ReadLine());
  15.             string season = Console.ReadLine();
  16.             string holiday = Console.ReadLine();
  17.  
  18.  
  19.             var flowers = 0.0;
  20.             var flowDec = 2.0;
  21.  
  22.             int flowersCount = chrysQuant + roseQuant + tulipQuant;
  23.  
  24.             if ((season == "Spring" || season == "Summer") && holiday == "Y")
  25.             {
  26.                 flowers = (chrysQuant * 2 + roseQuant * 4.1 + tulipQuant * 2.5) * 1.15;
  27.  
  28.                 if (season == "Spring" && tulipQuant > 7)
  29.                 {
  30.                     flowers *= 0.95;
  31.  
  32.  
  33.                 }
  34.                 if (flowersCount > 20)
  35.                 {
  36.                      flowers *= 0.80;
  37.                 }
  38.  
  39.                
  40.  
  41.             }
  42.             else if ((season == "Spring" || season == "Summer") && holiday == "N")
  43.             {
  44.                  flowers = chrysQuant * 2 + roseQuant * 4.1 + tulipQuant * 2.5;
  45.  
  46.                 if (season == "Spring" && tulipQuant > 7)
  47.                 {
  48.                      flowers *= 0.95;
  49.  
  50.  
  51.                 }
  52.                 if (flowersCount > 20)
  53.                 {
  54.                      flowers *= 0.80;
  55.                 }
  56.  
  57.                
  58.             }
  59.             else if ((season == "Autumn" || season == "Winter") && holiday == "Y")
  60.             {
  61.                 flowers = (chrysQuant * 3.75 + roseQuant * 4.5 + tulipQuant * 4.15) * 1.15;
  62.  
  63.                 if (season == "Winter" && roseQuant >= 10)
  64.                 {
  65.                     flowers *= 0.90;
  66.  
  67.                 }
  68.                 if (flowersCount > 20)
  69.                 {
  70.                      flowers *= 0.80;
  71.                 }
  72.  
  73.                
  74.             }
  75.             else if ((season == "Autumn" || season == "Winter") && holiday == "N")
  76.             {
  77.                  flowers = chrysQuant * 3.75 + roseQuant * 4.5 + tulipQuant * 4.15;
  78.  
  79.                 if (season == "Winter" && roseQuant >= 10)
  80.                 {
  81.                      flowers *= 0.90;
  82.  
  83.                 }
  84.                 if (flowersCount > 20)
  85.                 {
  86.                      flowers *= 0.80;
  87.                 }
  88.  
  89.                
  90.             }
  91.  
  92.             flowers += flowDec;
  93.             Console.WriteLine($"{flowers:f2}");
  94.  
  95.  
  96.         }
  97.  
  98.     }
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement