Tapeworms belong to the class Cestoda within the phylum Platyhelminthes (flatworms). They are characterized by their ribbon-like bodies composed of segments called proglottids. Trematoda are flukes, Annelida are segmented worms, and Nematoda are roundworms.