Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace ConsoleApp17
- {
- class MyDate
- {
- private int day;
- private int month;
- private int year;
- public MyDate(int d, int m, int y)
- {
- day = d;
- month = m;
- year = y;
- }
- public int getDay()
- {
- return day;
- }
- public int getMonth()
- {
- return month;
- }
- public int getYear()
- {
- return year;
- }
- public void setDay(int newDay)
- {
- if (newDay >= 1 && newDay <= 31)
- {
- day = newDay;
- }
- }
- public void setMonth(int newMonth)
- {
- month = newMonth;
- }
- public void setYear(int newYear)
- {
- year = newYear;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement