Example #1
0
 public Airline(string dest, int flight, char type, weekDays day)
 {
     this.destination = dest;
     this.numOfFlight = flight;
     this.typeOfPlane = type;
     this.wd          = day;
     Airline.tableSize++;
 }
Example #2
0
 public Airline()
 {
     this.destination = "Minsk";
     this.numOfFlight = 1;
     this.typeOfPlane = 'A';
     this.wd          = weekDays.sun;
     Airline.tableSize++;
 }
Example #3
0
 public Airline()                                                                //first constructor
 {
     this.destination = "Minsk";
     this.numOfFlight = 1;
     this.typeOfPlane = 'A';
     this.wd          = weekDays.sun;
     this.flightID    = makeHash(destination, numOfFlight, typeOfPlane, wd);
     Airline.tableSize++;
 }
Example #4
0
 public Airline(string dest, int flight, char type, weekDays day)                                         //third constructor
 {
     this.destination = dest;
     this.numOfFlight = flight;
     this.typeOfPlane = type;
     this.wd          = day;
     this.flightID    = makeHash(destination, numOfFlight, typeOfPlane, wd);
     Airline.tableSize++;
 }
Example #5
0
 public Airline(string dest, int flight)                                         //second constructor
 {
     this.destination = dest;
     this.numOfFlight = flight;
     this.typeOfPlane = 'A';
     this.wd          = weekDays.sun;
     this.flightID    = makeHash(destination, numOfFlight, typeOfPlane, wd);
     Airline.tableSize++;
 }
Example #6
0
 public Airline(string des, int n, string ty, int t, weekDays day)
 {
     this.destination = des;
     this.number      = n;
     this.type        = ty;
     this.time        = t;
     this.wd          = day;
     this.FlightID    = makeHash(destination, number, type, wd);
     size++;
     Console.WriteLine("Конструктор с параметрами!");
 }
Example #7
0
 public Airline()
 {
     this.destination = "no";
     this.number      = 0;
     this.type        = "no";
     this.time        = 0000;
     this.wd          = weekDays.sun;
     this.FlightID    = makeHash(destination, number, type, wd);
     size++;
     Console.WriteLine("Конструктор без параметров!");
 }
Example #8
0
        public uint makeHash(string dest, int flight, char type, weekDays day)
        {
            int intRes = dest.Length + flight * 9 - (int)type;

            if (day > weekDays.thir)
            {
                intRes *= 54;
            }
            uint res = (uint)intRes;

            return(res);
        }
Example #9
0
        public uint makeHash(string des, int num, string t, weekDays day)
        {
            int intRes = des.Length + num * 9 - t.Length;

            if (day > weekDays.thir)
            {
                intRes *= 54;
            }
            uint res = (uint)intRes;

            return(res);
        }
Example #10
0
        private void btnAccessAnElement_Click(object sender, EventArgs e)
        {
            // Creating an instance of enum weekDays to access one element
            weekDays wd = weekDays.Monday;

            // Creating another instance of enum WeekDays to access one element
            weekDays wd1 = weekDays.Friday;

            // Display elements
            MessageBox.Show(wd.ToString());
            MessageBox.Show(wd1.ToString());
        }
Example #11
0
 static void Main(string[] args)
 {
     try
     {
         Console.WriteLine("Please enter the current day of the week.");            // prompting the user to enter the current day
         weekDays day = (weekDays)Enum.Parse(typeof(weekDays), Console.ReadLine()); // assigning the value to a variable of the enum data type created
         Console.WriteLine("Thank you. Today is " + day + ".");
         Console.ReadLine();
     }
     catch
     {
         Console.WriteLine("Please enter an actual day of the week.");
         Console.ReadLine();
     }
 }