In this code I'm not really sure what does keyword "const" is doing. My guess would be that it makes it not possible to change the private variables of the class, but i'm not sure. Despite that I cannot understand the difference of "const" being ahead or behind the method. Or is it the same thing?
class Date
{
public:
Date(unsigned int y, unsigned int m, unsigned int d);
Date(string yearMonthDay); // yearMonthDay must be in format "yyyy/mm/dd"
void setYear(unsigned int y);
void setMonth(unsigned int m);
void setDay(unsigned int d);
void setDate(unsigned int y, unsigned int m, unsigned int d);
unsigned int getYear() const;
unsigned int getMonth() const;
unsigned int getDay() const;
string getDate() const; // returns the date in format "yyyy/mm/dd"
void show() const; // shows the date on the screen in format "yyyy/mm/dd"
private:
unsigned int year;
unsigned int month;
unsigned int day;
};