I have written these codes for my 5th Semester here at MIT.