Why does my program return the error "ArrayIndex Out Of Bounds Exception: 4"?

Why would this fix it?