Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Harvest
  4. {
  5. class Program
  6. {
  7. private const double harvest = 0.40;
  8. private const double grapesneedforWine = 2.5;
  9. static void Main(string[] args)
  10. {
  11. int x = int.Parse(Console.ReadLine()); //kv m loze
  12. double y = double.Parse(Console.ReadLine()); //grozde da 1 kv.m
  13. int z = int.Parse(Console.ReadLine()); //nujni litra vino
  14. int workers = int.Parse(Console.ReadLine());
  15.  
  16. double grapes = x * y;
  17. double wine = Math.Floor(harvest * grapes) / grapesneedforWine;
  18.  
  19. if (wine > z)
  20. {
  21. Console.WriteLine($"Good harvest this year! Total wine: {wine} liters.");
  22. double litersLeft = wine - z;
  23. double wine1person = litersLeft / 3;
  24. Console.WriteLine($"{litersLeft} liters left -> {wine1person} liters per person.");
  25. }
  26. else
  27. {
  28. double needMore = Math.Floor(z - wine);
  29. Console.WriteLine($"It will be a tough winter! More {needMore} liters wine needed.");
  30. }
  31.  
  32.  
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement