Question: Program C# Im trying to get this program to pause at the end and say press any key to contuine instead of closing immediately after

Program C#

Im trying to get this program to pause at the end and say press any key to contuine instead of closing immediately after code has been ran.

using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Collections.Generic;

public class Program { public static void Main(string[] args) {

List items = new List(); Console.WriteLine("Enter first name: "); string Fname = Console.ReadLine(); items.Add(Fname); Console.WriteLine("Enter last name: "); string Lname = Console.ReadLine(); items.Add(Lname); Console.WriteLine("Enter street: "); string Street = Console.ReadLine(); items.Add(Street); Console.WriteLine("Enter City: "); string city = Console.ReadLine(); items.Add(city); Console.WriteLine("Enter state: "); string State = Console.ReadLine(); items.Add(State); Console.WriteLine("Enter Sip code: "); string Zip = Console.ReadLine(); items.Add(Zip);

Console.WriteLine("Costumers information: "); foreach (var item in items) { Console.WriteLine(UpperCaseMethod(item.ToLower())); }

} public static string UpperCaseMethod(string input) { if (String.IsNullOrEmpty(input)) throw new ArgumentException("ARGH!"); return input.First().ToString().ToUpper() + input.Substring(1); }

}

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!