Answer:
#include <iostream>
using namespace std;
int main() {
/*
What pet do you have? lemur
parrot
What pet do you have? cat
What pet do you have? stop
*/
string pet;
int num=1;
while (pet!="stop"){
cin>>pet;
cout<<"What pet do you have?";
if (pet!="stop"){
cout<<"you have one "<< pet<<" total numof # is "<<num++<<endl;
}
else{
cout<<"stop";
}
}
}
Step-by-step explanation:
you did not specify the language so i went with c++
i used while loop which will keep asking the user for an input until he/she write stop in order to break the loop
first i declared the data type of the input
used it as a conditionin the while loop
then printed the input everytime the loop runs