Respuesta :
The program illustrates the use of repetitive operations.
The program will be completed in C++, because the program segment provided in the question, was written in C++.
Replace /* Type your code here. */ with the following lines of code
//This gets input for userString
std::cin>>userString;
//This gets input for userNum
std::cin>>userNum;
//The following loop is repeated until the input is "quit"
while(std::strcmp(userString,"quit") != 0){
//This prints the required string
std::cout<<"Eating "<<userNum<<" "<<userString<<" a day keeps you happy and healthy.\n";
//This gets another input for userString, while the loop is active
std::cin>>userString;
//This gets another input for userNum, while the loop is active
std::cin>>userNum;
}
The program keeps getting input from the user until the input is "quit"
The complete program without comments is:
#include <iostream>
#include <cstring>
int main(void) {
char userString[50];
int userNum;
std::cin>>userString;
std::cin>>userNum;
while(std::strcmp(userString,"quit") != 0){
std::cout<<"Eating "<<userNum<<" "<<userString<<" a day keeps you happy and healthy.\n";
std::cin>>userString;
std::cin>>userNum;
}
return 0;
}
See attachment for sample run
Read more about C++ programs at:
https://brainly.com/question/17584261
