Honeywell Interview Question

I got a code with number of errors which I had to fix