#include<iostream.h>
#include<conio.h>
Class Ex
{
public:
int a;
void get()
{
cout<<"Enter The Values";
cin>> a
}
void chek()
{
if (a==1)
{
cout<<"Monday";
}
else if (a==2)
{
cout<<"Tuesday";
}
else if (a==3)
{
cout<<"Wednesday";
}
else if (a==4)
{
cout<<"Thursday";
}
else if (a==5)
{
cout<<"Friday";
}
else if (a==6)
{
cout<<"Saturday";
}
else if (a==7)
{
cout<<"Sunday";
}
else
{
cout<<"Enter Correct Values i.e Numbers From 1-7";
}
}
void main
Ex e ;
e.get();
e.chek();
}
Yes he should select something one either a is private and has a getter and setter ( if there is a requirement of them) or a is public and when it does not require a setter.
An example of class where data members are public could be a Point class.