Write the DisplayStrings() method called in the code below using a parameter array declared in the method header. The method should write its arguments in a single line, followed by a newline. What will the output be after running Main()?using static System.Console;class ParamsDemo{static void Main(){string[] names = {"Mark", "Paulette", "Carol"};DisplayStrings("Ginger");DisplayStrings("George", "Maria", "Thomas");DisplayStrings(names);}}
What will be an ideal response?
The DisplayStrings() method should be similar to the following code:
private static void DisplayStrings(params string[] people)
{
foreach(string person in people)
Write("{0} ", person);
WriteLine("\n");
}
The output should be:
Ginger
George Maria Thomas
Mark Paulette Carol
You might also like to view...
An operation on a stream of type T that produce a stream of type R by applying a function of type T -> R to each element of the first stream, is called
A) an iterating stream operator B) a reduction C) a mapping stream operator D) None of the above
A(n) ____________________ is out of bounds when it is not in the range of acceptable values.
Fill in the blank(s) with the appropriate word(s).
A tool that copies all formatting from one area to another.
What will be an ideal response?
The adjusted cell references in a copied and pasted formula are called _____ references.
A. related B. relative C. pasted D. alternative