Question: what are the characteristics of a well-written melody?
Answer: Most good melodies restrict their basic range to no more than an octave-and-a-half.
Most good melodies use repeating elements. ... 
Most good melodies are comprised of stepwise motion (i.e., move by scale steps), with occasional leaps. ... 
Most good melodies have a discernible relationship with the bass line.