| 11 | std::string ending(int date_day); |
| 12 | |
| 13 | int main() |
| 14 | { |
| 15 | std::cout << "Enter your date of birth." << std::endl; |
| 16 | int date_year {year()}; |
| 17 | int date_month {month()}; |
| 18 | int date_day {date(date_month, date_year)}; |
| 19 | |
| 20 | std::string months[] {"January", "February", "March", "April", "May", "June", "July", |
| 21 | "August", "September", "October", "November", "December" }; |
| 22 | |
| 23 | std::cout << std::endl; |
| 24 | std::cout << |
| 25 | std::format("You were born on the {} of {}, {}.", |
| 26 | std::to_string(date_day) + ending(date_day), |
| 27 | months[date_month - 1], |
| 28 | date_year |
| 29 | ) << std::endl; |
| 30 | } |
| 31 | |
| 32 | // Reads an integer that is between lower and upper inclusive |
| 33 | int validate_input(int lower, int upper, const std::string& description) |