Guest User

Untitled

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