Answer:
Following is given the code with all necessary description given as comments in it. I hope it will help you!
Step-by-step explanation:
9.5m questions
12.2m answers