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 ch9_3
{
    public partial class Form1 : Form
    {

        public static string dayName(int day)
        {
            switch (day)
            {
                case 1:
                    return "Saturday";
                case 2:
                    return "Sunday";
                case 3:
                    return "Monday";
                case 4:
                    return "Tuesday";
                case 5:
                    return "Wednesday";
                case 6:
                    return "Thursday";
                case 7:
                    return "Friday";
                default:
                    throw new ArgumentOutOfRangeException("Bad Day");
            }
        }
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int day = Convert.ToInt16(textBox1.Text);
            label2.Text = dayName(day);
        }
    }
}
