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.
-
Oil prices have increased a great deal in the last decade. The table below shows the average oil price for each year since 1949. Many companies use oil products as a resource in their own business...
-
A supersonic aircraft is flying parallel to the ground. When the aircraft is directly overhead, an observer sees a rocket fired from the aircraft. Ten seconds later the observer hears the sonic boom,...
-
Determine the resultant internal loading on the cross section through point C of the pliers. There is a pin at A, and the jaws at B are smooth. 20 N -120 mm- 40 mm 15 mm- 80 mm 30 20 N B
-
The following is a partial trial balance for the Green Star Corporation as of December 31, 2011: 100,000 shares of common stock were outstanding throughout 2011. Required: 1. Prepare a single-step...
-
Demanding Nursing profession. It has become an especially challenging hiring and ongoing management category in recent years. Covid, overall workload demands, advanced education requirements, and...
-
The paralegal is assigned the task of preparing an office legal memorandum. The memorandum is due in 10 days, and there is a 5-page limit. The facts and law are as follows: Facts: Mary was Tom's...
-
A forward contract may be used for which of the following? 1) A fair value hedge of an asset. 2) A cash flow hedge of an asset. 3) A fair value hedge of a liability. 4) A cash flow hedge of a...
-
Can roles be viewed as dynamic and context-dependent constructs, evolving over time and across different social contexts, or are they primarily static and predetermined by social structures ?
-
How does the 360-degree feedback method address the court's six stress issues depicted in Gerhart and Newman's reading? Since the Brito case, there has been growing evidence that the courts have very...
-
CRM refers to the effective use of all available resources: human, hardware, and information. Other groups routinely working with the cockpit crew, who are involved in decisions required to operate a...
-
following 10words are taken from Brent Staples' essay "Why Race Isn't as "Black" and "White"as We Think." ridiculed surveyor Emancipation slave genetic screening ancestry arbitrary swarming snickered...
-
What role does role-taking, empathy, and perspective-taking play in fostering social understanding and cooperation among individuals occupying different roles within a social system ?
-
The first six principles of the AHIMA Code of Ethics are pledges to uphold canons and conduct that relate to HIPAA privacy and security standards and related compliance legislation. For each of these...
-
Suppose that a business sells 6-month subscriptions to its monthly magazine. On January 1, the company receives a total of $600 for 10 subscriptions. To record this transaction, the company debits...
-
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
-
Who is currently in your own network that you could use for prospecting? How might you add to your network?
-
Pick any three of the sources of prospects discussed in the chapter and pick a product or service you like. Develop several ideas for how you would use each source to locate leads for the product or...
-
Why do you think a salesperson might experience call reluctance? How can it be overcome?
Study smarter with the SolutionInn App