Students who are interested to try this problem can earn and extra points or exemption for finals.  Solve the problem using PHP scripting language.

Show your codes on October 19, 2008 (9:00) to your instructor for checking and evaluation.

The problem was excerpt from HP CodeWars 2009.

Redundant Acronym Syndrome Syndrome

Task Description

From Wikipedia, the free encyclopedia:

The term RAS syndrome refers to the use of one of the words that make up an acronym as well as the abbreviation itself, thus in effect repeating that word. It stands for “Redundant Acronym Syndrome syndrome,” and is itself a humorous example of a redundant acronym.

Write a program that generates RAS syndrome acronyms.

Program Input

Each line of the input contains one or more words. The line of text will be no longer than 80 letters, spaces, and/or punctuation. The last line of the input is the word END.

automated teller machine
random access memory
alternating current
scholastic aptitude test
international standard book number
END

Program Output

The program must print the acronyms in RAS syndrome format. For this program you can assume that the repeated word is always the last word of the input line. Acronyms must be upper-case, regardless of the case of the input.

ATM machine
RAM memory
AC current
SAT test
ISBN number

  • Share/Bookmark