Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- char input;
- int PollAmount = 10;
- string CatAmount = "", DogAmount = "", TurtleAmount = "";
- do {
- cout << "Poll Amount = " << PollAmount << endl;
- cout << "Choose which animals do you like to pet: " << endl;
- cout << "1. Cat" << endl;
- cout << "2. Dog" << endl;
- cout << "3. Turtle" << endl;
- cout << "Submit the number: ";
- cin >> input;
- if (input == '1') {
- cout << "You Chose Cat!" << endl;
- PollAmount--;
- CatAmount += "|";
- }
- else if (input == '2') {
- cout << "You Chose Dog!" << endl;
- PollAmount--;
- DogAmount += "|";
- }
- else if (input == '3') {
- cout << "You Chose Turtle!" << endl;
- PollAmount--;
- TurtleAmount += "|";
- }
- else {
- cout << "Type the correct number" << endl;
- }
- cout << endl;
- } while (PollAmount > 0);
- cout << "THE RESULTS OF THE POLL" << endl;
- cout << "Cat = " << CatAmount << endl;
- cout << "Dog = " << DogAmount << endl;
- cout << "Turtle = " << TurtleAmount << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement