Solutions for first six questions.