Optimizing simple C++ grading program
There's probably much that can be done, but I'll give it a quick review:


Are only integer grades allowed?  They can be decimals in real life, and that would make for a more robust grading system.
Consider renaming UserNumber to something like numericalGrade.  The former sounds like it's for an ID number, not a grade.
Do not "list" variables at the top of a function in C++, unless it's absolutely necessary.  Here, you can declare UserNumber between the std::cout and std::cin.
There's no need for a Z case here.  Use a default case instead, which will be reached if no other case is reached.
You don't need an explicit return 0 at the end.  The compiler will do this return for you at the end of main() as successful termination is always implied here.