Question: Write a C# program using a Linq statement. Create a string list. Use Console.ReadLine() to collect values of firstName, lastName, street, city, state, zip, save

Write a C# program using a Linq statement.

Create a string list.

Use Console.ReadLine() to collect values of firstName, lastName, street, city, state, zip, save them to List.

Write a simple Linq statement, then call method ***UppercaseWords() to change first letter to uppercase.

Create a foreach statement to display the information (foreach (var in )).

***Method uppercaseWords() is provided and needs to be included entirely in the program:

public static string UppercaseWords(string value)

{

char[] array = value.ToCharArray();

if (array.Length >= 1)

{

if (char.IsLower(array[0]))

{

array[0] = char.ToUpper(array[0]);

}

}

for (int i = 1; i < array.Length; i++)

{

if (array[i - 1] == ' ')

{

if (char.IsLower(array[i]))

{

array[i] = char.ToUpper(array[i]);

}

}

}

return new string(array);

}

_______________________________________________OUTPUT____________________________________________________

(Note: The following information is provided by the user.)

Enter first name: michael

Enter last name: johnson

Enter street: 999 first street

Enter city: seattle

Enter state: washington

Enter Sip code: 98433

(The following information is generated automatically. There are upper case letters at the beginning of every word.)

Costumers information:

Michael

Johnson

999 First Street

Seattle

Washington

98433

Press any key to continue...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!