Advertisement
Guest User

Lutenica

a guest
Nov 23rd, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 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 Lutenitsa
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             double HowMuchTomatoes = double.Parse(Console.ReadLine());
  15.             double CountsofKasetiki = double.Parse(Console.ReadLine());
  16.             double CountofBurkani = double.Parse(Console.ReadLine());
  17.  
  18.             double formula1 = (HowMuchTomatoes / 5);
  19.             double formula2 = (formula1 / 0.535);
  20.             double formula3 = (formula2 / CountofBurkani);
  21.  
  22.             Console.WriteLine("Total lutenica: {0} kilograms.",Math.Round(formula1));
  23.  
  24.             if (formula3 > CountsofKasetiki)
  25.             {
  26.                 double num = Math.Floor(formula3 - CountsofKasetiki);
  27.                 double num1 = Math.Floor(formula2 - (CountsofKasetiki * CountofBurkani));
  28.                 Console.WriteLine("{0} boxes left.", num);
  29.                 Console.WriteLine("{0} jars left.", num1);
  30.             }
  31.             else
  32.             {
  33.                 double num = Math.Floor(CountsofKasetiki - formula3);
  34.                 double num1 = Math.Floor((CountsofKasetiki * CountofBurkani) - formula2);
  35.                 Console.WriteLine("{0} more boxes needed.",num);
  36.                 Console.WriteLine("{0} more jars needed.",num1);
  37.             }
  38.  
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement