Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- //#include <string>
- using namespace std;
- class czas
- {
- private:
- int rok;
- int miesiac;
- int dzien;
- string dzien_tygodnia;
- public:
- czas();
- czas(int, int, int, string);
- int get_rok();
- int get_miesiac();
- int get_dzien();
- string get_dzien_tygodnia();
- void set_rok(int);
- void set_miesiac(int);
- void set_dzien(int);
- void set_dzien_tygodnia(string);
- void wypisz();
- };
- int czas::get_rok()
- {
- return rok;
- }
- int czas:: get_miesiac()
- {
- return miesiac;
- }
- int czas:: get_dzien()
- {
- return dzien;
- }
- string czas:: get_dzien_tygodnia()
- {
- return dzien_tygodnia;
- }
- void czas::set_rok(int r)
- {
- rok = r;
- }
- void czas::set_miesiac(int m)
- {
- miesiac = m;
- }
- void czas::set_dzien(int d)
- {
- dzien = d;
- }
- void czas::set_dzien_tygodnia(string dt)
- {
- dzien_tygodnia=dt;
- }
- /* konstruktor:
- Nazwa_klasy::Nazwa_klasy([argumenty konstruktora]) : pole1(wartosc1), pole2(wartosc2) (...)
- {}
- */
- czas:: czas() : rok(2020), miesiac(03), dzien(29), dzien_tygodnia("niedziela")
- {
- }
- czas::czas(int r, int m, int d, string dt) : rok(r), miesiac(m), dzien(d), dzien_tygodnia(dt)
- {
- }
- void czas::wypisz()
- {
- // Miejsce na Twój kod
- }
- int main()
- {
- czas A(2020,1,1,"niedziela");
- A.wypisz();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement