need help with this

Write a program that capitalizes every other word in an input sentence until
punctuation is reached. After the punctuation, the rest of the sentence should be as
is in the input sentence. The sample input/output for the program should look like
the followings:
Input: Hello! Output: Hello!
Input: The quick brown fox jumped over the lazy river.
Output: The QUICK brown FOX jumped OVER the LAZY river.
Input: Homework was due yesterday, not tomorrow.
Output: Homework WAS due YESTERDAY, not tomorrow.
Topic archived. No new replies allowed.