mkpetrov

Untitled

Dec 22nd, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.23 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 Problem_03.Flowers
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int Hriz = int.Parse(Console.ReadLine());
  14.             int Roses = int.Parse(Console.ReadLine());
  15.             int Lal = int.Parse(Console.ReadLine());
  16.             string Season = Console.ReadLine();
  17.             string Holiday = Console.ReadLine();
  18.             var SumFlowers = Hriz + Roses + Lal;
  19.  
  20.             var HrizPrice = 0.0;
  21.             var RosesPrice = 0.0;
  22.             var LalPrice = 0.0;
  23.             var Sum = 0.0;
  24.            
  25.            
  26.  
  27.             if (Season=="Spring")
  28.             {
  29.                 HrizPrice = Hriz * 2.00;
  30.                 RosesPrice = Roses * 4.10;
  31.                 LalPrice = Lal * 2.50;
  32.                 Sum = HrizPrice + RosesPrice + LalPrice;
  33.             }
  34.             else if (Season=="Summer")
  35.             {
  36.                 HrizPrice = Hriz * 2.00;
  37.                 RosesPrice = Roses * 4.10;
  38.                 LalPrice = Lal * 2.50;
  39.                 Sum = HrizPrice + RosesPrice + LalPrice;
  40.             }
  41.             else if (Season=="Autumn")
  42.             {
  43.                 HrizPrice = Hriz * 3.75;
  44.                 RosesPrice = Roses * 4.50;
  45.                 LalPrice = Lal * 4.15;
  46.                 Sum = HrizPrice + RosesPrice + LalPrice;
  47.             }
  48.             else if (Season=="Winter")
  49.             {
  50.                 HrizPrice = Hriz * 3.75;
  51.                 RosesPrice = Roses * 4.50;
  52.                 LalPrice = Lal * 4.15;
  53.                 Sum = HrizPrice + RosesPrice + LalPrice;
  54.             }
  55.             if (Holiday=="Y")
  56.             {
  57.                 Sum = Sum + (Sum * 0.15);
  58.             }
  59.             if (Season=="Spring" && Lal>=7)
  60.             {
  61.                 Sum = Sum - (Sum * 0.05);
  62.             }
  63.             if (Season=="Winter" && Roses>=10)
  64.             {
  65.                 Sum = Sum - (Sum * 0.10);
  66.             }
  67.             if (SumFlowers>=20)
  68.             {
  69.                 Sum = Sum - (Sum * 0.20);
  70.             }
  71.             Sum = Sum + 2;
  72.             Console.WriteLine("{0:f2}",Sum);
  73.            
  74.         }
  75.     }
  76. }
Add Comment
Please, Sign In to add comment