1. Read or obtain the value of private member variables.
This must be done in a manner that maintains the integrity of the private member data.
2. Display the value of private member variables.
The displayed information should be user friendly, i.e., formatted in a fashion easily readable and understandably by the user.
3. Print the value of private member variables.
When an inappropriate attempt is made to change the value of a private data member, a properly written get function with good
characteristics will be programmed to notify the user. User management should receive written notification of all inappropriate
activity as soon as it occurs.
1. Modify the value of private data members.
Public set functions set the value of private data members. However, set functions should not just change data. Set functions must be
programmed to make sure what they are being called to do is correct before they do it. Properly written set functions are the first
line of defense against, “garbage in, garbage out.”
2. Validate the value of private data members.
When an inappropriate attempt is made to change the value of a private data member, a properly written set function will be
programmed to prevent the modification.
public class Department
private string departname;
public string GetDepartname()
public void SetDepartname( string a)