Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write the code necessary to read the Mad Lib from a file and prompt the user: (the prompt by the user is in Bold) Please

write the code necessary to read the Mad Lib from a file and prompt the user: (the prompt by the user is in Bold)

Please enter the filename of the Mad Lib: madlibZoo.txt Plural noun: boys Plural noun: girls Type of liquid: lemonade Adjective: fuzzy Funny noise: squeak Another funny noise: snort Adjective: hungry Animal: mouse Another animal: blue-fin tuna 

Note that there is a tab before each of the questions (ex: "Plural noun:")

Hints

Your program will not need to be able to handle files of unlimited length. The file should have the following properties (though you will need to do error-checking to make sure):

There are no more than 1024 characters total in the input file.

There are no more than 32 lines in the input file.

Each line in the input file has no more than 80 characters in it.

There are no more than 256 words in the input file including prompts.

Each word in the input file is no more than 32 characters in length.

Hint: To see how to declare and pass an array of strings, please see Chapter 3.0 of the text.

Assignment

Perhaps the easiest way to do this is in a two-step process:

1. Create the framework for the program using stub functions based on the structure chart from your design document.

2. Write each function. Test them individually before "hooking them up" to the rest of the program. You are not allowed to use the String Class for this problem; only c-strings!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions