Hi,
Change
switch(int Option)
into:
switch (Option)
Also, change
case 1:
{
Console.WriteLine("Displaying Director Options:");
Console.WriteLine("2. Display Students Details:");
Console.WriteLine("3. Display Councilors Details: ");
Console.WriteLine("4. Display Visits Details:");
Console.WriteLine("5. Add Student:");
Console.WriteLine("6. Remove Student:");
Console.WriteLine("7. Add Councilor:");
Console.WriteLine("8. Remove Councilor");
Console.WriteLine("9. Change Councilor Available Hours");
Console.WriteLine("10. Add Visit");
}
into:
case 1:
Console.WriteLine("Displaying Director Options:");
Console.WriteLine("2. Display Students Details:");
Console.WriteLine("3. Display Councilors Details: ");
Console.WriteLine("4. Display Visits Details:");
Console.WriteLine("5. Add Student:");
Console.WriteLine("6. Remove Student:");
Console.WriteLine("7. Add Councilor:");
Console.WriteLine("8. Remove Councilor");
Console.WriteLine("9. Change Councilor Available Hours");
Console.WriteLine("10. Add Visit");
break;
You don't need to use brackets. Don't forget
break;
before a next
case
of before the end of the
switch
.
Read more about
switch
here:
http://msdn.microsoft.com/en-us/library/06tc147t%28v=vs.110%29.aspx[
^]
[EDIT]
Also, change this:
Option = Console.ReadLine();
into this:
try
{
Option = Convert.ToInt32(Console.ReadLine());
}
catch
{
Console.WriteLine("Input string isn't in a correct format.");
continue;
}
[EDIT]
I'm sorry, but I found a few mistakes after I saw your screen shot.
First:
public int Option
{
get
{
return option;
}
set
{
if (value == 0 || value > 16)
{
Console.WriteLine("Invalid Option");
}
else
{option = value;}
}
}
You create a property INTO a function. That's not possible. Read more about properties:
http://msdn.microsoft.com/en-us/library/x9fsa0sw%28v=vs.80%29.aspx[
^]
Second:
Don't use
while (state = true)
Use
while (state == true)
Read more about the
==
operator:
http://msdn.microsoft.com/en-us/library/53k8ybth.aspx[
^]