Use Exceptions Rather Than Return Codes Back in the distant past there were many languages that didn't have exceptions.In those languages the techniques for handling and reportiing errors were limited.You either set an error flag or returned an error…