Complete script for assignement no.2