Hand in a full solution to the following question under the…