# Example of getting integer input, and quitting if
# the user types a string that cannot be converted.
# Program written as a function. 

# From the file inputCheck, bring in the function
# canBeInt
from inputCheck import canBeInt

# Everything happens inside this function
def main():

    # get input from the user
    inStr = input("enter your age: ")

    # canBeInt() is True when given a string that
    # can be converted to an integer.  So use "not".
    if not canBeInt(inStr):
        print("That's not a number.")
        # end the function
        return

    # canBeInt(inStr) must have been True; do rest of function
    age = int(inStr)
    remaining = 65 - age
    print("You can retire in",remaining,"years.")

# The whole program is just using this function main()
main()
