NelIfandieva

Pr02_Dzyyyn_Exercise06

Dec 12th, 2019
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace claswork
  8. {
  9.     class ProgramForCalculatingFans
  10.     {
  11.         public static void Main()
  12.         {
  13.             int targetProduction = int.Parse(Console.ReadLine());//1
  14.             int workersNumber = int.Parse(Console.ReadLine());//1
  15.             double workingDays = double.Parse(Console.ReadLine());//5
  16.  
  17.             const double singleGlassPrice = 4.20;
  18.             const double workingHoursPerDay = 8;
  19.             const double hoursForOneGlass = 5;
  20.  
  21.             double targetIncome = targetProduction * singleGlassPrice;//4.20
  22.             double totalWorkingTime = workersNumber * workingHoursPerDay * workingDays;
  23.             double realProduction = totalWorkingTime / hoursForOneGlass;
  24.             double realIncome = realProduction * singleGlassPrice;
  25.  
  26.             if(realIncome >= targetIncome)
  27.             {
  28.                 double moneyMore = realIncome - targetIncome;
  29.                 Console.WriteLine("{0:f2} lv. more.", moneyMore);
  30.             }
  31.             else
  32.             {
  33.                 double moneyLost = targetIncome - realIncome;
  34.                 Console.WriteLine("{0:f2} lv. less", moneyLost);
  35.             }
  36.         }
  37.     }
  38. }
RAW Paste Data