Advertisement
Guest User

main.cpp

a guest
Apr 29th, 2021
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. const string name = "Mittens";
  6.  
  7. bool theCat()
  8. {
  9. if (name == "Fido" || name == "Rover")
  10. {
  11. cout << "Error. Not a cat." << endl;
  12. return false;
  13. }
  14. else
  15. {
  16. cout << "Please do not " << name << endl;
  17. return true;
  18. }
  19. }
  20.  
  21. int main()
  22. {
  23. do cout << "Attempting the cat..." << endl;
  24. while (!theCat());
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement