Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions course03/homework00/date.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "date.h"

Date getDate()
{
int day;
int month;
int year;

std::cout << "Which day? ";
std::cin >> day;
std::cout << "Which month? ";
std::cin >> month;
std::cout << "Which year? ";
std::cin >> year;

Date date {day, month, year};

return date;
}

int main()
{
Date date1{17,05,1996};
date1.print();

Date date2=getDate();
date2.print();
}
17 changes: 17 additions & 0 deletions course03/homework00/date.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef DATE_H
#define DATE_H

class Date
{
public:
int m_day;
int m_month;
int m_year;

void print()
{
std::cout << m_day << "/" << m_month << "/"<< m_year;
}
};

#endif // DATE_H