Advertisement
plamen83

Untitled

Apr 4th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Problem_03.Flowers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var brHrizantemi = int.Parse(Console.ReadLine());
  10.             var brRozi = int.Parse(Console.ReadLine());
  11.             var brLaleta = int.Parse(Console.ReadLine());
  12.             var season = Console.ReadLine().ToLower();
  13.             var praznik = Console.ReadLine().ToLower();
  14.  
  15.             var priceHrizantemi = 0.0;
  16.             var priceRozi = 0.0;
  17.             var priceLaleta = 0.0;
  18.             var priceTotal = 0.0;
  19.  
  20.             if (season == "spring" || season =="summer")
  21.             {
  22.                 priceHrizantemi = 2;
  23.                 priceRozi = 4.1;
  24.                 priceLaleta = 2.5;
  25.             }
  26.             else if (season == "autumn" || season == "winter")
  27.             {
  28.                 priceHrizantemi = 3.75;
  29.                 priceRozi = 4.5;
  30.                 priceLaleta = 4.15;
  31.             }
  32.  
  33.             priceTotal = priceHrizantemi * brHrizantemi + priceRozi * brRozi + priceLaleta * brLaleta;
  34.  
  35.             if (praznik == "y")
  36.             {
  37.                 priceTotal *= 1.15;
  38.             }
  39.  
  40.             if (season == "spring" && brLaleta > 7)
  41.             {
  42.                 priceTotal *= 0.95;
  43.             }
  44.  
  45.             if (season == "winter" && brRozi > 9)
  46.             {
  47.                 priceTotal *= 0.9;
  48.             }
  49.  
  50.             if (brHrizantemi + brRozi + brRozi > 20)
  51.             {
  52.                 priceTotal *= 0.8;
  53.             }
  54.  
  55.             priceTotal += 2;
  56.  
  57.             Console.WriteLine("{0:f2}", priceTotal);
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement