Answer to Question #187399 in C++ for Lois

Question #187399

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;

}




1
Expert's answer
2021-04-30T02:04:20-0400
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;


}




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS