The document describes the requirements for a greeting method that takes a string as a parameter and returns a personalized greeting string. The method must handle null/empty values, uppercase names, two names separated by a comma, and an arbitrary number of names separated by commas with Oxford comma formatting.
The document describes the requirements for a greeting method that takes a string as a parameter and returns a personalized greeting string. The method must handle null/empty values, uppercase names, two names separated by a comma, and an arbitrary number of names separated by commas with Oxford comma formatting.
The document describes the requirements for a greeting method that takes a string as a parameter and returns a personalized greeting string. The method must handle null/empty values, uppercase names, two names separated by a comma, and an arbitrary number of names separated by commas with Oxford comma formatting.
Write a method Greet(string name) that interpolates name in a simple greeting. For
example, when name is "Bob", the method should return a string "Hello, Bob!". Handle nulls by introducing a stand-in. For example, when name is null (or an empty string), then the method should return the string "Hello, my friend!" Handle shouting. When name is all uppercase, then the method should shout back to the user. For example, when name is "JERRY" then the method should return the string "HELLO, JERRY!" Handle two names of input. When name is contains two names split by comma, then both names should be printed. For example, when name is "Jill, Jane", then the method should return the string "Hello, Jill and Jane!" Handle an arbitrary number of names as input. When name represents more than two names, separate them with commas and close with an Oxford comma and "and". For example, when name is "Amy, Brian, Charlotte", then the method should return the string "Hello, Amy, Brian, and Charlotte!"