You've found this site so presumably you've also heard about the Internet and the WWW?
There's also a very good search engine service called Google. You can get it to find things for you. So visit google.com and type in something like 'mastermind c++ program'.
How do you know they've got a teacher? If they have and this is their first idea about how to complete an assignment (- ask online strangers to send it them), they're beyond all hope anyway.
If they're just interested in learning how a mastermind game would work in C++ without going to the trouble of learning C++ first, google's probably their best bet ;)
If someone was interested in a mastermind program, they wouldn't have asked for the source.
If someone was interested in learning how to make a mastermind program, they would have asked specific questions and not just asked for the source.
The only reason I can see someone asking solely for the source is because they have an assignment and don't want to/don't know how to do it themselves.
But it is just an assumption. I guess I'm just a big old cynic.