I am learning C++ and i am on the topic classes(Inheritence),my friend told me that the way I am writing code is bad software engineering and said me to divide this code in 3 files main.cpp numbers.cpp and numbers.h but i am confused on how to do it he is out for his project and not responding my messages please help
Right because it IS good software engineering to split larger programs into multiple files. Usually one file per class or one file for a small group of smaller classes that do similar things (like your True and False classes).
Wrong because learning classes is complicated enough that it's unnecessary to deal with multiple files since the classes you create aren't that big.
Also, it's way easier to get a good view of the big picture of your program if everything is in one file.
So: during learning it's OK to keep everything in one file as long as it doesn't exceed hundreds of lines. But if you start programming "real" programs you better split up the code.
Well, no, sorry. I explicitly did NOT use your code for my example to give you the learning opportunity to do that yourself.
And since the structure of my example strongly resembles your code, it shouldn't be too hard.