The digestive system consists of an alimentary canal and digestive glands. The alimentary canal of cockroach is divided into foregut, midgut, and hindgut. the foregut opens into a gap, where undigested food is temporarily stored. the mouth opens into a short tubular pharynx, leading to a narrow tubular passage, the esophagus. The gastric sacks contain bacteria that the cockroach uses to digest its food.