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.
-
In February, Gardner, a schoolteacher with no experience in running a tavern, entered into a contract to purchase for $40,000 the Punjab Tavern from Meiling. The contract was contingent upon Gardners...
-
A negative feedback control system has the loop transfer function (a) When T = 0.2 s, find K such that the phase margin is 40° using the margin function, (b) Obtain a plot of phase margin versus...
-
What is Digital Systems direct labor efficiency variance for January? a. $75.00 F b. $225.00 F c. $232.50 F d. $1,350.00 F Digital Systems has budgeted three hours of direct labor per connector at a...
-
Larry is a professional gambler, specializing in dog racing. He spends 50 to 60 hours per week studying racing forms and placing bets at the track. During the current year, Larry has winnings of...
-
Find a power series representation for the following functions. State the radius of convergence \f
-
An investment company offers a bond linked to the FT100 index. On redemption the bond pays the face value plus the largest of A: the face value times the change in the index. Or B: 5% yearly interest...
-
3 . Physical counts of inventorya. Are not necessary under the perpetual system and should be taken at least once a monthb. Should be taken at least once a monthc. Are necessary to adjust for...
-
Variable Manufacturing Unit Cost Figurines Electrical Sets 20x1 Cost Projected Percent Increase 20x2 Cost Rounded to 7 Decimal Places 9.2000000 2.50% $9.4300000 (4.01) 1.2500000 2.50% $1.2812500...
-
Vin + R w 10 + C 0.1uF Vout Figure 1-RC Circuit Configuration 1 Calculate the RC time constant of the circuit in Figure 1 using Tau = R*C. C HH 0.1F + R Vi Vout in 10 Figure 2-RC Circuit...
-
2. For the given circuit i) Find Current flowing through all the resistances. ii) Find voltage across all the resistances. iii) Find voltage across Vab. iv) Find power dissipated across all the...
-
can you help me draw an AS IS diagram and TO BE diagram 2. Model Ontario Vaccine Passports issuance and validation process and generate the "AS IS" process diagram using the BPMN 2.0 notation (see...
-
Trace Dijkstra's shortest-path algorithm for the following graph starting at vertex 0: Origin 0 1 2 5 2 6 ~ 3 3 3 2 5 3 4 5 5
-
16. Articles 85 and 86 in the Treaty of Rome prohibited anticompetitive activities and policies in the field of transportation of member states? a. True b. False
-
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
-
Define a business transaction in the broad sense and give examples of the two different kinds of transactions.
-
What two equalities in accounting must be maintained in transaction analysis?
-
What is a T-account? What is its purpose?
Study smarter with the SolutionInn App