<jupyter_start><jupyter_text>Classes<jupyter_code>import jupytergraffiti
jupytergraffiti.api.transfer_graffitis()
#include<iostream>

class Date {

    private:
        int day;
        int month;
        int year;
    
    public:
        void SetDate(int day, int month, int year);
        int GetDay();
        int GetMonth();
        int GetYear();
};

void Date::SetDate(int day, int month, int year) {
    int day_numbers[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    if(year % 4 == 0 && year % 100 != 0 || year% 400 == 0)
        day_numbers[1]++;

    if(year < 1 || day < 1 || month < 1 || month > 12 || day > day_numbers[month - 1])
        throw std::domain_error("Invalid date!");

    Date::day = day; 
    Date::month = month; 
    Date::year = year;
}

int Date::GetDay() { 
    return day; 
}
int Date::GetMonth() { 
    return month; 
}
int Date::GetYear() { 
    return year; 
}
int main(){

   Date date;
   date.SetDate(29, 2, 2019);
   std::cout << date.GetDay() << "/" << date.GetMonth() << "/" << date.GetYear()  << "\n";
}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1712707182320442, 'fraction_numerical': 0.04419889502762431, 'mean_word_length': 2.65993265993266, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '419697', 'license': 'MIT', 'n_tokens_mistral': 447, 'n_tokens_neox': 385, 'n_words': 102, 'path': 'home/.ipynb_checkpoints/Access_Modifiers_Python-checkpoint.ipynb', 'repo_name': 'EarthMan123/Cpp-Notes', 'size': '1086'}