Develop a C program that will prompt the user to enter a series of words. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Develop a C program that will prompt the user to enter a series of words. The program will concatenate each word to a character array (building up a list of words one word at a time). Then the program will prompt the user for another word. If the user enters the word "DONE" (all in caps), the program will exit the loop and print the list of words. In order to keep the words from joining together, the program will need to concatenate a newline ("\n") after each word. The program should use a 1000 character single-dimensional array char to store the list of words. You can assume that the user will not exceed the 1000 character size. The array should be initialized to have an empty string (). The program should also use a separate 50 character single-dimensional char array for the word that the user will enter. When the user enters the word DONE, the program should exit the loop and print the list of words from the single- dimensional char array containing the list of words followed by a statement of how many characters are in the word list array (including the newline characters). The input and output of the program will look something like: Please enter a word: The Please enter a word: quick Please enter a word: brown Please enter a word: fox Please enter a word: jumps Please enter a word: OVER Please enter a word: the Please enter a word: lazy Please enter a word: dog. Please enter a word: DONE You entered: The quick brown fox jumped OVER the lazy dog. The total number of characters including newlines is 45. Develop a C program that will prompt the user to enter a series of words. The program will concatenate each word to a character array (building up a list of words one word at a time). Then the program will prompt the user for another word. If the user enters the word "DONE" (all in caps), the program will exit the loop and print the list of words. In order to keep the words from joining together, the program will need to concatenate a newline ("\n") after each word. The program should use a 1000 character single-dimensional array char to store the list of words. You can assume that the user will not exceed the 1000 character size. The array should be initialized to have an empty string (). The program should also use a separate 50 character single-dimensional char array for the word that the user will enter. When the user enters the word DONE, the program should exit the loop and print the list of words from the single- dimensional char array containing the list of words followed by a statement of how many characters are in the word list array (including the newline characters). The input and output of the program will look something like: Please enter a word: The Please enter a word: quick Please enter a word: brown Please enter a word: fox Please enter a word: jumps Please enter a word: OVER Please enter a word: the Please enter a word: lazy Please enter a word: dog. Please enter a word: DONE You entered: The quick brown fox jumped OVER the lazy dog. The total number of characters including newlines is 45.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Show every m Mb+ (H) is a composition of at most three reflections. (a) Show that the three angle bisectors of T meet at a single point. (b) If each side of T has the same length, then show that...
-
You are required to develop a software that will let a user organize his or her music collection. Instead of a database you will be storing all the information in a file. Your program will be an...
-
Jayhawks decided to acquire Tarheels corporation. Because Jayhawks is larger, after the acquisition, the combined company will use Jayhawks cost of debt and Jayhawks Debt and Equity percentages You...
-
A car is randomly selected at a traffic safety checkpoint, and the car has 6 cylinders. Determine whether the given values are from a discrete or continuous data set.
-
A computer manufacturer offers a help line that purchasers can call for help 24 hours a day, 7 days a week. Clearing these calls for help in a timely fashion is important to the companys image. After...
-
The term for-profit corporation means which of the following? A. The business must make a profit or forfeit its status. B. The business may make or lose money without changing its status. C. The...
-
With roots that go back to before the Great Depression, Marriott International (www.marriott.com) has come a long way from its founding by husband and wife John and Alice Marriott. As of 2014,...
-
On August 31, 2016, Bouquet Floral Supply had a $170,000 debit balance in Accounts Receivable and a $6,800 credit balance in Allowance for Bad Debts. During September, Bouquet made the following...
-
How does one cultivate empathy amidst the complex interplay of socio-cultural dynamics? Explain
-
The 450-room Hotel Fernando is a four-star full-service hotel in San Petresco. It is highly regarded among both locals and tourists. Its service standards and ameni- ties complement its exquisite...
-
3. Consider the following schema for a movie database (the primary keys of the tables are underlined). Foreign key constraints are also listed under the schema of each table. Person (ID, FirstName,...
-
Was the plan that was presented similar to what we have described in this chapter? What would you have changed in the presentation? Why?
-
What must be subtracted from the cost of a building or equipment to find its depreciable base?
-
Are costs to get an asset into service, such as the delivery cost we pay when we buy equipment, treated as current expense, or depreciated?
-
What accounting principle requires the use of depreciation?
-
Have you ever attended the formal presentation of a business plan? If so, was it successful in obtaining the desired funding?
-
The 2002 law designed to improve corporate governance is titled the _____ . Multiple Choice Pension Reform Act ERISA Financial Services Modernization Act Sarbanes-Oxley Act Which of the following is...
-
During 2012, Cheng Book Store paid $483,000 for land and built a store in Georgetown. Prior to construction, the city of Georgetown charged Cheng $1,300 for a building permit, which Cheng paid. Cheng...
-
a. Write an application for Codys Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery check, or brake inspection. Allow the user to enter a string that...
-
Write an application that prompts a user for two integers and displays every integer between them. Display a message if there are no integers between the entered values. Make sure the program works...
-
A structure that allows repeated execution of a block of statements is a ____________. a. Cycle b. Ring c. Loop d. Band
-
A plate-and-frame filter press operating at a constant $\Delta P$ of $150 \mathrm{psi}$ is to be used to filter a sludge containing $2 \mathrm{lb}_{\mathrm{m}}$ of solids per $\mathrm{ft}^{3}$ of...
-
A slurry is being filtered at a net rate of $10,000 \mathrm{gal} /$ day by a plate-and-frame filter with 15 frames with an active filtering area of $1.5 \mathrm{ft}^{2}$ per frame, fed by a positive...
-
A slurry containing $40 %$ solids by volume is delivered to a rotary drum filter, which is $4 \mathrm{ft}$ in diameter and $6 \mathrm{ft}$ long and operates at a vacuum of $25 \mathrm{in}$....
Study smarter with the SolutionInn App