Yes, this formula does work ( you forgot to multiply by pi though). It is basically a simplified version of the 2 equations that you would generally use to calculate the surface area of a cylinder.
To find the surface area of a cylinder, we have 2 components: the 2 circular faces, and the curved rectangle.
The area of the 2 faces is given by 2(pi)r^2
The area of the rest of the cylinder is just a rectangle the height equal to the height of the cylinder and width equal to the circumference:
Adding these two together gives you the total surface area:
2(pi)r^2 + h(D)(pi)
Lets rewrite it to achieve the equation your classmate suggested.
2(pi)r^2 + h(D)(pi), change the D to 2r:
2(pi)r^2 + h(2r)(pi), factor out common terms (2r(pi)):
2r(pi)(r + h), change the 2r back to D:
D(pi)(r + h)
There it is