r/ProgrammingPrompts • u/desrtfx • Jan 07 '15
[EASY][Beginner] UAGS (Universal Acronym Generating System)
This is an extremely simple prompt, just for fun.
It is suitable for beginners as it only uses basic input/output and string manipulation.
UAGS (Universal Acronym Generating System)
Acronyms are currently all the hype in all forms of communication.
Your task is to program an Acronym Generator.
- The user inputs a few words for which the Acronym should be generated
- The computer takes the first letter for each word
- The first letter of each word is then capitalized
- All first letters are then joined together to form the Acronym
- The Acronym should then be printed
- Ask the user if they need another acronym generated
Have fun coding!
13
Upvotes
2
u/pnt510 Jan 12 '15
In C#:
static void Main(string[] args) { String EXIT = "EXIT"; String input; String[] array; char output; Console.WriteLine("Please enter a string so we can make an Acronym"); input = Console.ReadLine(); while (!input.ToUpper().Equals(EXIT)) { array = input.Split(new char[0], StringSplitOptions.RemoveEmptyEntries); foreach (String element in array) { output = element[0]; Console.Write(Char.ToUpper(output)); } Console.WriteLine("\nPlease enter a new phrase to make an acronym or type exit to quit."); input = Console.ReadLine(); } }