Help needed with combining two sketches together

Did you read the sticky thread at the top of this section titled "Read this before posting a programming question" ?

Why not?