Guest User

Untitled

a guest
Jan 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ShortCircuitExample
  4. {
  5. public class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. if (IsStoreOpen() && NeedGrocery())
  10. {
  11. Console.WriteLine("Go to store");
  12. }
  13. else
  14. {
  15. Console.WriteLine("Stay at home");
  16. }
  17.  
  18. Console.Read();
  19. }
  20.  
  21. private static bool NeedGrocery()
  22. {
  23. Console.WriteLine("Need grocery");
  24. return false;
  25. }
  26.  
  27. private static bool IsStoreOpen()
  28. {
  29. Console.WriteLine("Is store open");
  30. return false;
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment