Question: Write a program that prompts a user to enter a date in the following format: Month day, year such as November 2 2 , 2

Write a program that prompts a user to enter a date in the following format: Month day, year such as November 22,2024, extracts from it the month, day, and year, and displays it in the following format year/month/day such as 2024/11/22. Your program should have and use at least the following functions: (a) getDate that prompts a user to enter a date as a string in the format of Month day, year and returns it.(b) extract that takes as its parameter a date in the format of Month day, year, extracts the month, the day, and the year from it, and returns them as 3 separate strings. (c) convertMonth that takes as its parameter a month as a word and converts it to a month as a number, both are strings. (d) display that takes as its parameters 3 strings corresponding to the month as a number, the day and the year, and displays the date in the following format year/month/day.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!