using System.Collections.Generic;
private static Dictionary<string,Student> Students = new Dictionary<string, Student>();
public static void Main()
var command = GetUserCommand();
while (!string.IsNullOrEmpty(command))
Console.WriteLine("Unkown command");
command = GetUserCommand();
public static string GetUserCommand()
Console.WriteLine("please enter a command");
return Console.ReadLine();
public static void AddStudent()
Console.WriteLine("please enter the student ID");
var studentID = Console.ReadLine();
Console.WriteLine("please enter the student Name");
var studentName = Console.ReadLine();
var newStudent = new Student() { StudentID = studentID, Name = studentName };
Students.Add(newStudent.StudentID, newStudent);
public static void PrintStudent()
Console.WriteLine("please enter student ID");
var studentID = Console.ReadLine();
if (Students.ContainsKey(studentID))
var student = Students[studentID];
Console.WriteLine(string.Format("ID = {0}, Name = {1}", student.StudentID, student.Name));
Console.WriteLine("Student Not Found");
public string Name { get; set; }
public string StudentID { get; set; }