Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int biscuitsPerDayPerOneWorker = int.Parse(Console.ReadLine());
- int allWorkersinFactory = int.Parse(Console.ReadLine());
- int competitionFactory = int.Parse(Console.ReadLine());
- double myProductionPerDay = 0;
- double totalProduction = 0;
- double differenceBetweenFactorys = 0;
- double percentDifference = 0;
- for (int i = 0; i < 30; i++)
- {
- myProductionPerDay = biscuitsPerDayPerOneWorker * allWorkersinFactory;
- if (i % 3 == 0)
- {
- myProductionPerDay = Math.Floor(myProductionPerDay * 0.75);
- }
- totalProduction += myProductionPerDay;
- }
- Console.WriteLine($"You have produced {totalProduction} biscuits for the past month.");
- if (totalProduction > competitionFactory)
- {
- differenceBetweenFactorys = totalProduction - competitionFactory;
- percentDifference = differenceBetweenFactorys / competitionFactory * 100;
- Console.WriteLine($"You produce {percentDifference:f2} percent more biscuits.");
- }
- else
- {
- differenceBetweenFactorys = competitionFactory - totalProduction;
- percentDifference = differenceBetweenFactorys / competitionFactory * 100;
- Console.WriteLine($"You produce {percentDifference:f2} percent less biscuits.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement