Program done for assignment 2