using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EX2
{
    public partial class Form1 : Form
    {
        Clock Clock1;
        public Form1()
        {
            InitializeComponent();
            Clock1  = new Clock();
       
        }
        public class Clock
        {

            byte Hour=0, Minute=0, Second=0;
            public void AddSecond()
            {
                if (Second == 59)
                { Minute++; Second = 0; }
                else
                    Second++;
                if (Minute == 60)
                { Hour++; Minute = 0; }
                
            }
            public byte GetHour
            {
                get { return Hour; }
            }
            public byte GetMinute
            {
                get { return Minute; }
            }
            public byte GetSecond
            {
                get { return Second; }
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Clock1.AddSecond();
            lblHour.Text = Clock1.GetHour.ToString();
            lblMinute.Text = Clock1.GetMinute.ToString();
            lblSecond.Text = Clock1.GetSecond.ToString();
        }
        
    }
    
}
