static class ListTest
{
static List<string> _list; // Static List instance
static ListTest()
{
// Allocate the list.
_list = new List<string>();
}
public static void DisplayTest(string SeatsInput)
{
_list.Add(SeatsInput);
}
public static void DisplayStuff()
{
//
// Write out the results.
//
foreach (var value in _list)
{
Console.WriteLine("Your seats are" +value);
}
}
}
static string CustomerChooseSeats()
{
Console.WriteLine("\n\nWhich seats would the customer like to seat?: ");
string SeatsInput = Console.ReadLine();
return SeatsInput;
}
//AND THEN IN THE MAIN
string SeatsInput = CustomerChooseSeats()
DisplayStuff()
I just started learning C# and trying to make a project based on the Cinema app. I can't seem to figure out how to store data after the input from 'string SeatsInput' into and then print out the values of the lists into a method?
Any suggestions?