#include #include using namespace std; // function to get a word from the user // and add it to the array void get_word( string prompt, string words[], int next_index ) { string word; cout << prompt; cin >> word; words[ next_index ] = word; } int main() { // array of words (assume maximum of 20) const int MAX_WORDS = 20; string words[ MAX_WORDS ]; // get the words from the user.... get_word( "Please enter a first name: ", words, 0 ); get_word( "Please enter a scary noun: ", words, 1 ); get_word( "Please enter an adjective: ", words, 2 ); get_word( "Please enter a noun: ", words, 3 ); get_word( "Please enter a number: ", words, 4 ); cout << "Once upon a time, " << words[0] << " was walking to class.\n"; cout << "Suddenly, a " << words[1] << " jumped out from behind a tree.\n"; cout << words[0] << " pulled a " << words[2] << ' ' << words[3] << " from his backpack.\n"; cout << "\"Stay back,\" he cried, but it was too late.\n"; cout << "The " << words[1] << " ate " << words[0] << " in " << words[4] << " bites.\n\nTHE END.\n"; return 0; }