Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Complete the program to read the needed values from input, that the existing output statement can use to output a short story.
#include <iostream>
using namespace std;
int main() {
cout << "name";
string location;
int number;
string pluralNoun;
cout << name << " went to " << location << " to buy " << number << " different types of " << pluralNoun << "." << endl;
return 0;
}
using namespace std;
int main() {
cout << "Enter name"<<endl;
string name;
cin>>name;
string location;
cout<<"Enter location"<<endl;
cin>>location;
int number;
cout<<"Enter number"<<endl;
cin>>number;
cout<<"Enter a plural noun"<<endl;
string pluralNoun;
cin>>pluralNoun;
cout<<endl<<endl;
cout << name << " went to " << location << " to buy " << number << " different types of " << pluralNoun << "." << endl;
return 0;
}
Comments
Leave a comment