Adding assignment 8 coverted to C#