Questions attached as a document. Just paste or attach the working code with output