Assigment 6 : exceptiom handling

HOW TO SOLVE QUESTION NUMBER 3,4,5