Advertisement
fbinnzhivko

Problem 03. Flowers

Dec 21st, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.49 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.Remoting.Channels;
  4.  
  5. namespace ConsoleApplication
  6. {
  7.     internal class Program
  8.     {
  9.         public static void Main(string[] args)
  10.         {
  11.             var hrizantemi = decimal.Parse(Console.ReadLine());
  12.             var roze = decimal.Parse(Console.ReadLine());
  13.             var laleta = decimal.Parse(Console.ReadLine());
  14.             var seacon = Console.ReadLine();
  15.             var happyDay = Console.ReadLine();
  16.  
  17.             decimal total = 0;
  18.  
  19.             if (seacon == "Spring")
  20.             {
  21.                 total = hrizantemi * (decimal) 2 + roze * (decimal) 4.10 + laleta * (decimal) 2.5;
  22.  
  23.                 if (happyDay == "Y")
  24.                 {
  25.                     total *= (decimal) 1.15;
  26.                 }
  27.                 if (laleta > 7)
  28.                 {
  29.                     total *= (decimal) 0.95;
  30.                 }
  31.                 if (hrizantemi + roze + laleta > 20)
  32.                 {
  33.                     total *= (decimal) 0.8;
  34.                 }
  35.             }
  36.             else  if (seacon == "Winter")
  37.             {
  38.                 total = hrizantemi * (decimal) 3.75 + roze * (decimal) 4.5+ laleta * (decimal) 4.15;
  39.  
  40.                 if (happyDay == "Y")
  41.                 {
  42.                     total *= (decimal) 1.15;
  43.                 }
  44.                 if (roze > 10)
  45.                 {
  46.                     total *= (decimal) 0.9;
  47.                 }
  48.                 if (hrizantemi + roze + laleta > 20)
  49.                 {
  50.                     total *= (decimal) 0.8;
  51.                 }
  52.             }
  53.             else  if (seacon == "Autumn")
  54.             {
  55.                 total = hrizantemi * (decimal) 3.75 + roze * (decimal) 4.5+ laleta * (decimal) 4.15;
  56.  
  57.                 if (happyDay == "Y")
  58.                 {
  59.                     total *= (decimal) 1.15;
  60.                 }
  61.                 if (hrizantemi + roze + laleta > 20)
  62.                 {
  63.                     total *= (decimal) 0.8;
  64.                 }
  65.             }
  66.             else
  67.             {
  68.                 total = hrizantemi * (decimal) 2 + roze * (decimal) 4.10 + laleta * (decimal) 2.5;
  69.  
  70.                 if (happyDay == "Y")
  71.                 {
  72.                     total *= (decimal) 1.15;
  73.                 }
  74.                 if (hrizantemi + roze + laleta > 20)
  75.                 {
  76.                     total *= (decimal) 0.8;
  77.                 }
  78.             }
  79.             Console.WriteLine("{0:f2}", total + 2);
  80.         }
  81.  
  82.     }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement