Einzelnen Beitrag anzeigen
Ungelesen 15.03.12, 09:20   #5
Your_Conscience
Hinter dir!
 
Registriert seit: Apr 2010
Beiträge: 1.124
Bedankt: 487
Your_Conscience ist noch neu hier! | 0 Respekt Punkte
Standard

Du musst jetzt nur noch die Fehlerabfragen und die Ausgabe für den Kalender hinzufügen.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int month, year, day;
            string read;

            Console.WriteLine("Write \"exit\" to exit.\n");
            do
            {
                //get month
                Console.Write("month: ");
                read = Console.ReadLine();
                //ToDo check for errors
                month = Convert.ToInt32(read);

                //get year
                Console.Write("year: ");
                read = Console.ReadLine();
                //ToDo check for errors
                year = Convert.ToInt32(read);

                //get day of week of the 1st day of month
                DateTime dateValue = new DateTime(year, month, 1);      //year, month, day
                day = (int)dateValue.DayOfWeek;     //sunday = 0, monday = 1, ..., saturday = 6

                //if (dateValue.Year >= current year && dateValue.Year <= 3000)
                    /*print calendar*/


                //else print error
            } while (Console.ReadLine() != "exit");
        }
    }
}
Your_Conscience ist offline   Mit Zitat antworten