Advertisement
fbinnzhivko

Untitled

Dec 22nd, 2016
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.47 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Problem_03.Flowers
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int Hriz = int.Parse(Console.ReadLine());
  10.             int Roses = int.Parse(Console.ReadLine());
  11.             int Lal = int.Parse(Console.ReadLine());
  12.             string Season = Console.ReadLine();
  13.             string Holiday = Console.ReadLine();
  14.             var sumFlowers = Hriz + Roses + Lal;
  15.  
  16.             var HrizPrice = 0.0;
  17.             var RosesPrice = 0.0;
  18.             var LalPrice = 0.0;
  19.  
  20.             if (Season == "Spring" || Season =="Summer")
  21.             {
  22.                 HrizPrice = Hriz * 2.00;
  23.                 RosesPrice = Roses * 4.10;
  24.                 LalPrice = Lal * 2.5;
  25.             }
  26.             else if (Season == "Autumn" || Season == "Winter")
  27.             {
  28.                 HrizPrice = Hriz * 3.75;
  29.                 RosesPrice = Roses * 4.50;
  30.                 LalPrice = Lal * 4.15;
  31.             }
  32.             var sum = HrizPrice + RosesPrice + LalPrice;
  33.  
  34.             if (Holiday == "Y")
  35.             {
  36.                 sum *= 1.15;
  37.             }
  38.             if (Season == "Spring" && Lal >= 7)
  39.             {
  40.                 sum *= 0.95;
  41.             }
  42.             if (Season == "Winter" && Roses >= 10)
  43.             {
  44.                 sum *= 0.9;
  45.             }
  46.             if (sumFlowers >= 20)
  47.             {
  48.                 sum *= 0.8;
  49.             }
  50.             Console.WriteLine("{0:f2}", sum + 2);
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement