The while loop isnt working. i get an error when it hits the break to get out of the loop. the error is no loop statement to break out of.
static void Main(string[] args)
{
accounts myclass = new accounts();
string userin;
myclass.fillAccounts();
//int i = 0;
//while (i != 1)
do
{
}
while (userin != "x")
{
//use the following menu:
Console.WriteLine("*****************************************");
Console.WriteLine("enter an a or A to search account numbers");
Console.WriteLine("enter a b or B to average the accounts");
Console.WriteLine("enter an x or X to exit program");
Console.WriteLine("*****************************************");
Console.Write("Enter option-->");
userin = Console.ReadLine();
if (userin == "a" || userin == "A")
{
myclass.searchAccounts();
}
else if (userin == "b" || userin == "B")
{
myclass.averageAccounts();
}
else if (userin == "x" || userin == "X")
{
break;
}
else
{
Console.WriteLine("You entered an invalid option");
}
}
}