Getting "'string' does not name a type" Error

Like AWOL said, use String.

Do you see the difference between what you have "string" and what you were told "String"?