Another way to say "writing a program is for meeting a need" is "A program is written to meet a need."