Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 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 CakeTycooon
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. ulong cakesPerDay = ulong.Parse(Console.ReadLine());
  14. double flourPerCake = double.Parse(Console.ReadLine());
  15. uint flourKgA = uint.Parse(Console.ReadLine());
  16. uint truffle = uint.Parse(Console.ReadLine());
  17. uint pricePerTruffle = uint.Parse(Console.ReadLine());
  18.  
  19.  
  20. double cakes = flourKgA / flourPerCake;
  21. ulong truffleTotal = (ulong)truffle * pricePerTruffle;
  22. double cakePrice = (truffleTotal / cakesPerDay) * 1.25;
  23.  
  24. double flourRequired = cakesPerDay * flourPerCake;
  25. double kiloNeeded = flourRequired - flourKgA;
  26.  
  27. if (cakes>=cakesPerDay)
  28. {
  29. Console.WriteLine("All products available, price of a cake: {0:F2}",cakePrice);
  30. }
  31. else
  32. {
  33. Console.WriteLine("Can make only {0} cakes, need {1:F2} kg more flour",Math.Floor(cakes),kiloNeeded);
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement