Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bookmark 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,

Bookmark

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions