LexarG56

Generation

generate functionSun, 18 Jun 2023

Hacer que un caso default regrese a la tarea anterior

public static String getDayOfWeek(int dayNumber) { String dayOfWeek = ""; if(dayNumber == 1) { dayOfWeek = "Monday"; } else if(dayNumber == 2) { dayOfWeek = "Tuesday"; } else if(dayNumber == 3) { dayOfWeek = "Wednesday"; } else if(dayNumber == 4) { dayOfWeek = "Thursday"; } else if(dayNumber == 5) { dayOfWeek = "Friday"; } else if(dayNumber == 6) { dayOfWeek = "Saturday"; } else if(dayNumber == 7) { dayOfWeek = "Sunday"; } else { dayOfWeek = "Weekday"; } return dayOfWeek; }

Questions about programming?Chat with your personal AI assistant