Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- const string name = "Mittens";
- bool theCat()
- {
- if (name == "Fido" || name == "Rover")
- {
- cout << "Error. Not a cat." << endl;
- return false;
- }
- else
- {
- cout << "Please do not " << name << endl;
- return true;
- }
- }
- int main()
- {
- do cout << "Attempting the cat..." << endl;
- while (!theCat());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement