Write the function chop. It should be a void function that takes a string by reference and removes all but the first three characters of the string. For example, if the string passed in is "function" it should be changed to "fun". You do not need to worry about parameters with less than three characters.
Design note: Returning a new string and not modifying the parameter would likely be a better function design. We are writing it this way just to practice using references.
Write the function sign. It should take an int parameter and return a bool. It returns true if the number is greater than 0, and false if the number is less than zero. If the number is exactly 0, you should throw a logic_error with any message you like.
Write the function middleJob. It should call onlyPositive and pass it number. If onlyPositive returns a result, middleJob should return that answer. If onlyPositive throws an exception, middleJob should catch the exception and return -1.
Note: It is possible to just recreate the logic of onlyPositive and use an if/else to make middleJob return the right value. You should avoid solving it this way. Use try...catch