Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3.  
  4. string numberOfApples = "0";
  5.  
  6. Console.WriteLine("How many apples do you want");
  7. numberOfApples = Console.ReadLine();
  8.  
  9. while(int.Parse(numberOfApples) >= 0)
  10. {
  11. Console.WriteLine("Do you need another bag");
  12. string response = Console.ReadLine();
  13. if (response == "yes" && int.Parse(numberOfApples) == 10)
  14. {
  15. Console.WriteLine("You will need 2 bags");
  16. Console.WriteLine("Next please!");
  17. }
  18. }
  19. Console.ReadLine();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement