Advertisement
koksibg

Harvest

Jul 19th, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 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 Harvest
  8. {
  9.     class Harvest
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double X = double.Parse(Console.ReadLine());
  14.             double Y = double.Parse(Console.ReadLine());
  15.             double Z = double.Parse(Console.ReadLine());
  16.             double Workers = double.Parse(Console.ReadLine());
  17.             // YIELD
  18.             double harvest = X * Y;
  19.             // For Wine
  20.             double ForWine = 0.4 * harvest;
  21.             // Wade Wine
  22.             double ProducedWine = ForWine / 2.5;
  23.             if (ProducedWine < Z)
  24.             Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(Z - ProducedWine));
  25.             else if (ProducedWine >= Z)
  26.             {
  27.                 Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(ProducedWine));
  28.                 Console.WriteLine("{0} liters left -> {1} liters per person.", Math.Ceiling(ProducedWine - Z), Math.Ceiling((ProducedWine - Z) / Workers));
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement