static void Main(string[] args) { while (true) { int menu = g_menu(); if (menu == 1) { Console.WriteLine("\n" + "Please Enter the name, surname and gpa"); string name = Console.ReadLine(); string surname = Console.ReadLine(); string s_gpa = Console.ReadLine(); int gpa = int.Parse(s_gpa); Console.WriteLine(Student.create(name, surname, gpa)); } if (menu == 4) { for (int i = 0; i < Student.k; i++) { Console.WriteLine(Student.store[i] + "\n"); } } if (menu == 3) { Console.WriteLine("Please Enter GPA"); string j = Console.ReadLine(); int set = int.Parse(j); for (int i = 0; i < Student.k; i++) { if (set == Student.store[i].gpa) { Console.WriteLine(Student.store[i]); } } } if (menu == 0) { //something to quit } } Console.ReadKey(); }