help getting program to add second function to first

here is my code that works but for this program when it manipulations the second function meaning when it turns for example 23 to 32 i need help getting
it to add to the first function when it is manitipated here is the code.