Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design a program that will read a series of titles from an input file (via Linux redirection), one per line. The titles will be in
Design a program that will read a series of titles from an input file (via Linux redirection), one per line. The titles will be in an unorthodox mix of upper and lowercase letters and words may be separated by more than 1 blank. Reformat each title so that the first character (if it is a letter) of each word is capitalized and all remaining letters are lowercase each word is separated by exactly one blank space for example, "the CAT in the hat" becomes "The Cat in The Hat". At least one function (in addition to main) must be used. The string data type must be used. Never use global variables. Never use go to statements. File can only be read one time. The required output (displayed to the screen) from the program is your name, lab and lecture section #s and exercise # a list of the reformatted titles, one per line the input file will not be empty. There will be one title per line. Each title will consist of 1 or more words. There will be no leading spaces before the first word in the title. There will be at least 1 blank space between each word (there may be more). There will be a linefeed after the last character of the last word in a title (no trailing blanks). The program need only attempt to capitalize the first character of a word. For example, if a word in the title is "9TH", it should be reformatted to "9th". In other words, the program does not have to find the first letter in a word and capitalize it
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started