Answer :
Answer:
The function is written in C++:
void madLib(string adjective,string noun1,string adverb,string verb,string noun2){
cout<<"The "+verb+" "+noun1+" "+adjective+" "+noun2+" the "+adverb;
}
Explanation:
This line defines the function
void madLib(string adjective,string noun1,string adverb,string verb,string noun2){
This line generates and returns the output string
cout<<"The "+verb+" "+noun1+" "+adjective+" "+noun2+" the "+adverb;
NB: I've added the full source code as an attachment where you can test various input strings