1. Clean format:
Input a line of strings of mixed cases, format each word (words are strings delimited by spaces) so that they are capitalised. Output the formatted line.
2. Stammer Bob:
Bob stammers when facing long words. He speaks all words with less than or equal to 5 letters fluently, but for each word with more than 5 letters, each extra letter causes him to repeat the word once more. For example, when you say ‘Good Morning Bob’, he will have to reply ‘Good Morning Morning Morning George George’.
Input a sentence, output how Bob actually pronounces it.
3. Letter from Moscow:
Your friend lives in Moscow. He sends you email messages. Because of the extreme cold, people have a different accent there. They pause after each word, and at the end of each sentence they yell. This even affects the way they write emails, for each word they write, they always add a comma after, and wherever we use a comma or full stop, they always use an ‘!’. You may receive a message from Moscow saying ‘Good, day, mate! How, are, you! I, don’t, yell! I’m, just, friendly!’.
Input a line of message, output the result after translating to the Moscow accent.
4: Rome was not built in a day
We all know that Rome was not built in a day. Apparently Rome was built in a year.
Store you name and your age in variables. Then print out the name followed by the age when Rome is built if you start now. For example, if name is 'George' and age is 12, then the output will be:
No comments:
Post a Comment