CSharp - Write program to Output Spanish Day of Week

Requirements

You will write a program that displays the Spanish version of the day of week for a date entered by the user.

Hint

You can find the day of the week using the DayOfWeek property of the DateTime object.

The conversion to Spanish can be made using a series of conditions.

Demo

using System;
class Program/* w  w  w.j  av a  2 s .  c o m*/
{
    static void Main(string[] args)
    {
        Console.Write("Enter a date: ");
        string input = Console.ReadLine();
        DateTime enteredDate = Convert.ToDateTime(input);

        // Finding day of week (in enumeration) 
        DayOfWeek dayOfWeek = enteredDate.DayOfWeek;

        // Spanish texts 
        string spanish = "";
        if (dayOfWeek == DayOfWeek.Monday)
            spanish = "Lunes";
        if (dayOfWeek == DayOfWeek.Tuesday)
            spanish = "Martes";
        if (dayOfWeek == DayOfWeek.Wednesday)
            spanish = "Miercoles";
        if (dayOfWeek == DayOfWeek.Thursday)
            spanish = "Jueves";
        if (dayOfWeek == DayOfWeek.Friday)
            spanish = "Viernes";
        if (dayOfWeek == DayOfWeek.Saturday)
            spanish = "Sabado";
        if (dayOfWeek == DayOfWeek.Sunday)
            spanish = "Domingo";
    }
}

Result