How to Compile C/C++ in Ubuntu for Educational Purposes

This tutorial targets especially beginners in Linux and particularly Ubuntu, users who have just recently switched from Windows to Ubuntu and are facing this question: "how can I compile and run my C or C++ programs in Ubuntu?". Most of these users study C or C++ at school and are usually used from Windows with an IDE (Integrated Development Environment - a code editor which offers many other functions, including compiling and running the source code) like Dev-C++ or Code::Blocks.