using System; public class date { private static string[] month_names = {"","January","February","March","April","May","June", "July","August","September","October","November", "December"}; private static string[] day_names = {"Sunday","Monday","Tuesday","Wednesday","Thursday", "Friday","Saturday"}; private int d_,m_,y_; public date(int d, int m , int y) { d_=d; m_=m; y_=y; } public date() { d_=1; m_=1; y_=1; } public void print() { Console.WriteLine("{0,2}/{1,2}/{2,4}", d_,m_,y_); } public void print_month() { Console.WriteLine("{0,2}/{1}/{2,4}", d_,month_names[m_],y_); } private int day_of_week_index() { int index, day, month, year; day = d_; month = m_; year = y_; if (month > 2) month -= 2; else { month += 10; year--; } index = ((13 * month - 1) / 5) + day + (year % 100) + ((year % 100) / 4) + ((year / 100) / 4) - 2 * (year / 100) + 77; index = index - 7 * (index / 7); if (index == 7) index = 0; return (index); } public void print_day() { Console.WriteLine("{0,4}/{1,2}/{2}", y_,m_,day_names[day_of_week_index()]); } } class c2104 { public static void Main() { date date1 = new date(); date date2 = new date(11,2,1952); date tom = new date(7,9,91); date doug = new date(16,2,1979); Console.Write("First date: "); date1.print(); date1.print_month(); date1.print_day(); Console.Write("Second date: "); date2.print(); date2.print_month(); date2.print_day(); tom.print_day(); doug.print_day(); } }//