Advertisement
SuperLemrick

Find Birthday

Dec 8th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Find_Birthday
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.         private string FindDay(int year, int month, int day)
  19.         {
  20.             DateTime birthdayDate = new DateTime(year, month, day);
  21.             string dayOfWeek = birthdayDate.DayOfWeek.ToString();
  22.             return dayOfWeek;
  23.         }
  24.         private void numericYear_ValueChanged(object sender, EventArgs e)
  25.         {
  26.  
  27.         }
  28.  
  29.         private void numericMonth_ValueChanged(object sender, EventArgs e)
  30.         {
  31.  
  32.         }
  33.  
  34.         private void numericDay_ValueChanged(object sender, EventArgs e)
  35.         {
  36.  
  37.         }
  38.  
  39.         private void FindButton_Click(object sender, EventArgs e)
  40.         {
  41.             int year = (int)numericYear.Value;
  42.             int month = (int)numericMonth.Value;
  43.             int day = (int)numericDay.Value;
  44.  
  45.             string dayString = FindDay(year, month, day);
  46.  
  47.             MessageBox.Show("Your were born on a: " + dayString);
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement