Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Find_Birthday
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private string FindDay(int year, int month, int day)
- {
- DateTime birthdayDate = new DateTime(year, month, day);
- string dayOfWeek = birthdayDate.DayOfWeek.ToString();
- return dayOfWeek;
- }
- private void numericYear_ValueChanged(object sender, EventArgs e)
- {
- }
- private void numericMonth_ValueChanged(object sender, EventArgs e)
- {
- }
- private void numericDay_ValueChanged(object sender, EventArgs e)
- {
- }
- private void FindButton_Click(object sender, EventArgs e)
- {
- int year = (int)numericYear.Value;
- int month = (int)numericMonth.Value;
- int day = (int)numericDay.Value;
- string dayString = FindDay(year, month, day);
- MessageBox.Show("Your were born on a: " + dayString);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement