Solution (source code)

= Solution

Suppose the only distinct eigenvalues are $d$ and $\theta$. As in part (c), $A$ acts by $d$ on $\operatorname{span}\{\mathbf e\}$ and by $\theta$ on $\mathbf e^\perp$, so its <spectral decomposition> is
$$
A=\theta I+\frac{d-\theta}{n}J.
$$
Every diagonal entry of an adjacency matrix is zero, giving
$$
\theta+\frac{d-\theta}{n}=0.
$$
Thus every off-diagonal entry is the same number $(d-\theta)/n=-\theta$. Since these entries belong to $\{0,1\}$ and the graph is connected with at least two vertices, that common value must be one. Hence $A=J-I$ and $G$ is the <complete graph> $K_n$.

Conversely, $K_n$ has adjacency matrix $J-I$, with eigenvalue $n-1$ on $\operatorname{span}\{\mathbf e\}$ and eigenvalue $-1$ on $\mathbf e^\perp$. Therefore the requested graphs are precisely
$$
\boxed{K_n\quad(n\geq2)},
$$
as stated by the <connected regular graph with two adjacency eigenvalues> characterization.