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--+=%., or mixtures of letters and symbols, ike '.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 threelines.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 18 This Line Contains Symbols &Lots Of Spaces! Example 2

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions