This is a very basic C++ program that demonstrates data protection in a very simple way.

Data protection in Object Oriented Programming is controlling access to all attributes is one of the most important concepts of object-oriented design. By using methods to control access to attributes you can provide a much higher level of security for your class as well as providing many programming advantages.

 

Output of the Program: