Limit cycles for a class of continuous and discontinuous cubic polynomial differential systems