public override void number_Sea_on_the_Continent() { Planet_Earth pop = new Planet_Earth(); int number_Sea = pop.Coutry_America.Length; Console.WriteLine($"Number Sea: {number_Sea}"); }
public override void Result_Sort() { Planet_Earth nw = new Planet_Earth(); Console.WriteLine("Before Sort:"); foreach (string s in nw.island_America) { Console.Write("{0}, ", s); } Console.WriteLine("After Sort:"); bool flag = true; while (flag) { flag = false; for (int i = 0; i < nw.island_America.Length - 1; ++i) { if (nw.island_America[i].CompareTo(nw.island_America[i + 1]) > 0) { string buf = nw.island_America[i]; nw.island_America[i] = nw.island_America[i + 1]; nw.island_America[i + 1] = buf; flag = true; } } } foreach (string s in nw.island_America) { Console.Write("{0}, ", s); } }
public override void list_() { Planet_Earth nw = new Planet_Earth(); Console.WriteLine($"List: {nw.list}"); foreach (int item in nw.list) { Console.Write($"{item}, "); } }
public override void Country_on_the_Continent() { Planet_Earth nw = new Planet_Earth(); Console.WriteLine("Country on the continent: "); foreach (string s in nw.island_America) { Console.Write("{0}, ", s); } }
public override void Del_elem() { Console.Write("ENTER INDEX OF THE ELEMENT TO REMOVE(max 6): "); int index = int.Parse(Console.ReadLine()); if (index > 5) { Console.WriteLine("Error"); return; } Console.Write("ENTER INDEX OF THE ELEMENT TO REMOVE(max 2): "); int index1 = int.Parse(Console.ReadLine()); if (index1 > 2) { Console.WriteLine("Error"); return; } Console.Write("ENTER INDEX OF THE ELEMENT TO REMOVE(max 3): "); int index2 = int.Parse(Console.ReadLine()); if (index1 > 3) { Console.WriteLine("Error"); return; } Planet_Earth nw = new Planet_Earth(); nw.Result_Sort(); for (int i = index; i < nw.Sea_North_America.Length; ++i) { if (i < nw.Sea_North_America.Length - 1) { nw.Sea_North_America[i] = nw.Sea_North_America[i + 1]; } } for (int i = 0; i < nw.Sea_North_America.Length; ++i) { Console.WriteLine($"Value array Sea_North_America[{i}] { nw.Sea_North_America[i]}"); } /////////////////////////////////////////////////////////// for (int i = index1; i < nw.Coutry_America.Length; ++i) { if (i < nw.Coutry_America.Length - 1) { nw.Coutry_America[i] = nw.Coutry_America[i + 1]; } } for (int i = 0; i < nw.Coutry_America.Length; ++i) { Console.WriteLine($"Value array Coutry_America[{i}] { nw.Coutry_America[i]}"); } /////////////////////////////////////////////////////////// for (int i = index; i < nw.island_America.Length; ++i) { if (i < nw.island_America.Length - 1) { nw.island_America[i] = nw.island_America[i + 1]; } } for (int i = 0; i < nw.island_America.Length; ++i) { Console.WriteLine($"Value array Island_America[{i}] { nw.island_America[i]}"); } }