Advertisement
silvana1303

honey harvest

May 22nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4. {
  5.     class exam
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string flowerType = Console.ReadLine();
  10.             int flowers = int.Parse(Console.ReadLine());
  11.             string season = Console.ReadLine();
  12.             double quantity = 0;
  13.  
  14.             if (season == "Spring")
  15.             {
  16.                 if (flowerType == "Sunflower" || flowerType == "Mint")
  17.                 {
  18.                     quantity = 10;
  19.                 }
  20.                 else if (flowerType == "Daisy" || flowerType == "Lavender")
  21.                 {
  22.                     quantity = 12;
  23.                 }
  24.             }
  25.             else if (season == "Summer")
  26.             {
  27.                 if (flowerType == "Sunflower" || flowerType == "Daisy" || flowerType == "Lavender")
  28.                 {
  29.                     quantity = 8;
  30.                 }
  31.                 else
  32.                 {
  33.                     quantity = 12;
  34.                 }
  35.             }
  36.             else
  37.             {
  38.                 if (flowerType == "Sunflower")
  39.                 {
  40.                     quantity = 12;
  41.                 }
  42.                 else
  43.                 {
  44.                     quantity = 6;
  45.                 }
  46.             }
  47.  
  48.             if (season == "Spring")
  49.             {
  50.                 if (flowerType == "Daisy" || flowerType == "Mint")
  51.                 {
  52.                     quantity *= 1.10;
  53.                 }
  54.             }
  55.  
  56.             double beeWork = flowers * quantity;
  57.  
  58.             if (season == "Summer")
  59.             {
  60.                 beeWork *= 1.10;
  61.             }
  62.             else if (season == "Autumn")
  63.             {
  64.                 beeWork *= 0.95;
  65.             }
  66.  
  67.             Console.WriteLine($"Total honey harvested: {beeWork:f2}");
  68.         }
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement