Question: !!C++!! 18THE halfCaps PROBLeM Write a function halfCaps that accept an input stream and an output stream as arguments. The input stream contains a sequence

!!C++!!

!!C++!! 18THE halfCaps PROBLeM Write a function halfCaps that accept an input

18THE halfCaps PROBLeM Write a function halfCaps that accept an input stream and an output stream as arguments. The input stream contains a sequence of words. Your function should output the same sequence of words with alternating casing (lowercase, uppercase, lowercase, uppercase, etc). The first word, third word, fifth word, and all other "odd" words should be in lowercase letters, whereas the second word, fourth word, sixth word, and all other "even" words should be in uppercase letters. For example, suppose the input ontains the following words. The QWick brown fox jumPED over the Sleepy student For the purposes of this problem, we will use whitespace to separate words. You can assume that the sequence of words will not contain any numbers or punctuation and that each word will be separated by one space. For the input above, your function should produce the following output: the QUICK brown FOX jumped OVER the SLEEPY student Your output should separate each word by a single space. The output may end with a space if you like. Note that the input stream may contain no words or may contain an even or odd number of words

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!