Пример #1
0
 public static void sort(names[] People) //sorts by last name by alphabetic order
 {
     for (int i = 0; i < People.Length - 1; i++)
     {
         for (int pos = 0; pos < People.Length - 1; pos++) //pos intianted by 0,then pos < People length -1
         {
             if (People[pos + 1].lname.CompareTo(People[pos].lname) < 0)
             {
                 names temp = People[pos + 1];  //temp file assigned to people[pos+1]
                 People[pos + 1] = People[pos]; //assigns people to the next array slot
                 People[pos]     = temp;
             }
         }
     }
 }
Пример #2
0
 static void Main()
 {
     Console.SetWindowSize(160, 40);                     //Sets window size
     Console.OutputEncoding = System.Text.Encoding.UTF8; //unicode used for desgin
     questionare[] answers   = new questionare[17];      //array used for questionare struct
     money[]       rewards   = new money[16];            //array used for moeny struct
     string[]      Chosen    = new string[1];            //array used to for the top1 finalist
     string[]      Finalists = new string[10];           //array used for top10 finalists
     names[]       People    = new names[30];            //array used to names struct
     welcome();                                          //welcome
     read(People);                                       //reads millionare txt
     sort(People);                                       //sorts ppl from last name to first name
     readingquestions(answers);                          //reads questions
     readingmoney(rewards);                              //reads money
     options();                                          //displays options
     menu(People, Finalists, Chosen, answers, rewards);  //displays menu
     Top10(People);
     Console.ReadLine();
 }