Without reading your assignment (and it's your homework, I'm certainly not going to do it) there are a couple of things you can do to your code which will modularise it and make it easier to read.
Firstly, your code is 3 basic chunks.
1) Init
2) Loop
2.1) Menu write and input
2.2) Obey commands
3) Dunno - your code just ends in mid method.
So I would make it three chunks:
static void Main(string[] args)
{
Initialize();
bool exit = false;
while (!exit)
{
string response = GetUserInput();
exit = ProcessUserInput(response);
}
}
Now you Main method is small, and easy to read - and it does nothing complex.
Note that I have moved your string arrays and other variables outside Main - since they will be referred to by other aspect of teh program, it makes sense that they are class level, not method local variables.
GetUserInput is (at present) simple:
private static string GetUserInput()
{
Console.WriteLine("---------------What do you want to do ?---------------");
Console.WriteLine("");
Console.WriteLine("Add a person (a).");
Console.WriteLine("Find a person(s).");
Console.WriteLine("Display current person (p).");
Console.WriteLine("Delete current person (d)");
Console.WriteLine("Calculate and display pay slip for current person (c)");
Console.WriteLine("");
Console.WriteLine("Press 'x' to Exit. ");
return Console.ReadLine();
}
Again, this is now simple, and clear.
The complex one is your ProcessUserInput:
private static bool ProcessUserInput(string input)
{
bool result = false;
switch (input.ToLower())
{
default:
UnknownInput(input);
break;
case "x":
result = true;
break;
case 'a':
AddPersons();
break;
...
}
return result;
}
Again, you can see what is happening at each stage, and it is all simple.
You move the complexity of adding people to a self-contained method and let it worry about it.
At each stage, you are making the program less complex and easier to read.
Over to you to give it a try, and fill in the methods you need. Don't forget that they can be modularised as well!
Good luck!