Advertisement
Guest User

Untitled

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