Turkalp Kucur

Turkalp Kucur

  • NA
  • 50
  • 18.6k

soldier attending automation

Oct 29 2012 11:48 AM
Hello my friends.

I want to simulate a soldier attend simulation.


I have two arrays. First one is string[] soldier, which consists of soldier names. Second one is string[] cities, consisting of the cities to be attended.


There are two cases:


1. number of soldiers<number of cities.


I have developed the following method:
           


                 for (int i = 0; i<askerler.Length; i++)    // works ok.
                {
                   lstresult.Items.Add(askerler[i] + "-" + sehirler[i]);

                }

2. number of soldiers>number of cities.


I could not be able to use the same method.


please help.


NOTE: each soldier must be attended to different cities, if avaiable.


Answers (2)