  In this paper, we give a representation of the average of complete joint
weight enumerators of two linear codes of length $n$ over $\mathbb{F}_{q}$ and
$\mathbb{Z}_{k}$ in terms of the compositions of $n$ and their distributions in
the codes. We also obtain a generalization of the representation for the
average of $g$-fold complete joint weight enumerators of codes over
$\mathbb{F}_{q}$ and $\mathbb{Z}_{k}$. Finally, the average of intersection
numbers of a pair of Type III (resp. Type IV) codes, and its second moment are
found.
