You will Output Spanish Day of Week using switch statement.
You can use the switch statement as an if-series replacement if the repeated branching is based on the same value.
The switch keyword is followed by a variable or expression whose value determines which branch the program will take.
using System; class Program/* w w w . j a v a 2 s. com*/ { static void Main(string[] args) { // Input 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 = ""; switch (dayOfWeek) { case DayOfWeek.Monday: spanish = "Lunes"; break; case DayOfWeek.Tuesday: spanish = "Martes"; break; case DayOfWeek.Wednesday: spanish = "Miercoles"; break; case DayOfWeek.Thursday: spanish = "Jueves"; break; case DayOfWeek.Friday: spanish = "Viernes"; break; case DayOfWeek.Saturday: spanish = "S?bado"; break; case DayOfWeek.Sunday: spanish = "Domingo"; break; } } }