Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. using System;
  2.  
  3. namespace cockieFactory
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int numCockies = int.Parse(Console.ReadLine());
  10.  
  11.  
  12.  
  13. string product = "";
  14. bool flour = false;
  15. bool eggs = false;
  16. bool sugar = false;
  17.  
  18. for (int i = 1; i <= numCockies; i++)
  19. {
  20.  
  21. while (product != "Bake!")
  22. {
  23. product = Console.ReadLine();
  24.  
  25. if (product == "flour")
  26. {
  27. flour = true;
  28. }
  29. else if (product == "eggs")
  30. {
  31. eggs = true;
  32. }
  33. else if (product == "sugar")
  34. {
  35. sugar = true;
  36. }
  37.  
  38. }
  39. if (eggs || flour || sugar)
  40. {
  41. Console.WriteLine($"Baking batch number {i}...");
  42.  
  43. }
  44. else
  45. {
  46. Console.WriteLine("The batter should contain flour, eggs and sugar!");
  47. }
  48. flour = false;
  49. eggs = false;
  50. sugar = false;
  51. product = "";
  52. }
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement