Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problems trying to write a madlibs program, here\'s the instructions for the ass

ID: 3913324 • Letter: P

Question

Problems trying to write a madlibs program, here's the instructions for the assginment. Write a menu-based program that will allow the user to play Mad Libs! There should be are four different Mad Libs that the user may play. You must have a minimum of five functions main function call function to display the menu, get user’s choice, open appropriate file according to choice, read from appropriate file how many questions or prompts there are for the particular mad libs game, call the necessary functions to create two arrays based on the number of questions/prompts, read the questions/prompts from the appropriate file, close the file. Call all other functions getInfoFromUser & printStory. Make sure to deallocate any arrays that were allocated during program. Remember also that the menu should continue to display until the user decides to end the game. showMenuGetChoice shows the menu, get the user’s choice, validate the user’s choice, return the users choice from this function createStringArray accepts an integer indicating the size of the array to be created, dynamically allocates a new string array of this size & returns a pointer to this array. getInfoFromUser this function accepts three parameters: pointer to question array, pointer to answer array, and the array size. The function supplies the user with each question or prompt (from the question array) and then allows the user to enter in an answer (put this in the answer array). printStory function this function accepts three parameters: the user’s choice (so you know what file to open), the answer array, and the array size. Open the appropriate file (for example pirateText.txt), make sure the file exists and if it does, print the story file and print out answers from the answer array as necessary. You will do the following repeatedly: read in a line from a file, print the line, print an answer from the array. You may not have any global variables even if they are constant. The user must be able to run the program as many times as they wish. Please help, I can not figure out how to create 2 arrays (questions and answers arrays) from reading one text file (with the size needed on the first line) and then how to include those in as arugments to print out the story text file while printing the answer array inside the story. Im also stuck on how to take the user's choice and create a string array function that uses a specified txt file from the user menu. here's an example of a question text file:

15

noun:

adjective:

verb:

adverb:

noun:

adjective:

plural noun:

plural noun:

plural noun:

part of the body:

noun:

noun:

noun:

noun:

part of the body:

here's an example of the corresponding story text file:

Ye can always pretend to be a bloodthirsty

, threatening everyone by waving yer

sword in the air, but until ye learn to

like a pirate, ye'll never be

accepted as an authentic

. So here's what ye do: Cleverly work into yer daily converstaions

pirate phrases such as "Ahoy there,

," "Avast, ye

," and "Shiver me

." Remember to drop all yer gs when ye say such words as sailin', spittin', and fightin'. This will give ye a/an

start to being recognized as a swashbucklin'

. Once ye have the lingo down pat, it helps to wear a three-cornered

on yer head, stash a/an

in yer pants, and keep a/an

perched atop yer

. Aye, now ye be a real pirate!

i was using a do-while loop with a switch statement for input validation in the menu. Im just confused how to use pointers as parameters to pass the correct arrays to the functions so I get the desired output.

Explanation / Answer

MENU DRIVEN PROGRAM #include #include #include #include #include using namespace std; class file { private: int roll; float age; char name[100]; public: void input(); void show(); char *getn() { return name; } };file fileobj; void file::input() { coutroll>>age; gets(name); } void file::show() { cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote