Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 Capitalizing Words This task requires writing a C program which reads text from standard input (one character at a time) and outputs the text

image text in transcribed

2 Capitalizing Words This task requires writing a C program which reads text from standard input (one character at a time) and outputs the text with the capitalization of some characters changed. Specifically, your program must capitalize the first character of each word in the text. Formally, a 'word' will be defined as any sequence of non-space characters, so 'raspberry' and 'pear' would be considered words, but so would sequences of punctuation or symbols, like-t=%., or mixtures of letters and symbols, like ',raspberry,'. As in the previous part, the end of the input stream will be signalled by the # character, and you may assume that the # character appears nowhere in the input. except to signal the end of the input stream. In the output, the first character of each word must be changed to uppercase, unless the word begins with a non-letter character, in which case it will be left unchanged. Other than the first character of each word, all other characters must be output without any modification. Your program must generate no other output besides the output described (including prompts to the user, like 'Enter some text'). Programs which generate extraneous output will be considered incorrect The submission for this part must be contained in a file called capitalize.c Examples Examples of the behavior of a correct implementation of capitalize.c are shown below. As in the previous section, user input is shown in blue and the program's output is shown in black. Example 1 (posted as three_lines.txt) This is a line of text This Is A Line Of Text THIS LiNE conTAINS unusual CAPITALization THIS LiNE ConTAINS Unusual CAPITALization This line contains symbols & lots of spaces This Line Contains Symbols & Lots Of Spaces! Example 2 watch out for words at the beginning and end Watch Out For Words At The Beginning And End

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

Transactions On Large Scale Data And Knowledge Centered Systems Iv Special Issue On Database Systems For Biomedical Applications Lncs 6990

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Christian Bohm ,Johann Eder ,Claudia Plant

2011th Edition

3642237398, 978-3642237393

More Books

Students also viewed these Databases questions