Added in the necessary Answers to the first question. Now all I need to do is program that in….