public Airline(string dest, int flight, char type, weekDays day) { this.destination = dest; this.numOfFlight = flight; this.typeOfPlane = type; this.wd = day; Airline.tableSize++; }
public Airline() { this.destination = "Minsk"; this.numOfFlight = 1; this.typeOfPlane = 'A'; this.wd = weekDays.sun; Airline.tableSize++; }
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++; }
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++; }
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++; }
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("Конструктор с параметрами!"); }
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("Конструктор без параметров!"); }
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); }
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); }
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()); }
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(); } }