I need help with a programming assignment
I need help with a programming assignment
-
Paste the following code into the main() method. Modify the code; so that it works (You’ll have to make 2 small modifications). It should output the value of each string in the array called names.
string[] names = { “Al Dente”, “Anna Graham”, “Earle Bird”, “Ginger Rayle”, “Iona Ford” };
int i = 0;
while (i < names.Length)
{
Console.WriteLine(names[0]);
}
2. Modify the code from problem 1, so that it outputs a number and then a person’s name using the following output statement.
Console.WriteLine(“{0,2}. {1}”, i, names[i]);
3. Modify the code from problem 6, so that it uses a foreach loop as opposed to a while loop. The output should appear exactly the same as it did after step 2.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


