728x90
public static class Appointment
{
public static DateTime Schedule(string date) => DateTime.Parse(date);
public static bool HasPassed(DateTime date) => date < DateTime.Now;
public static bool IsAfternoonAppointment(DateTime date) => date >= date.AddHours(12) && date < date.AddHours(18);
public static string Description(DateTime date) => $"You have an appointment on {date}.";
public static DateTime AnniversaryDate() => new DateTime(DateTime.Now.Year, 9, 15, 0, 0, 0);
}
https://exercism.org/tracks/csharp/exercises/booking-up-for-beauty
728x90
'c# > 연습문제' 카테고리의 다른 글
Annalyn's Infiltration (0) | 2023.02.06 |
---|---|
Elon's Toys (0) | 2023.02.06 |
문제 21~25 풀이 (0) | 2023.02.06 |
문제 1~20 풀이 (0) | 2023.02.02 |
코딩 트레이닝 추천도서 (0) | 2023.02.02 |