Question: Write a C++ code for this project, the user will enter one , single integer that represents a date in the ISO 8601 format. Your

Write a C++ code for this project, the user will enter one, single integer that represents a date in the ISO 8601 format. Your input should be in the form YYYYMMDD (no dashes/no spaces/year 1000 or later). From the integer in this form, your program will output the date in the format we are familiar with in the United States, MM/DD/YYYY. In your output, you may also omit leading 0s (example for February 15, 2019, you may represent it as 2/15/2019, instead of 02/15/2019).

Examples:

If 20191216 is entered, 12/16/2019 would be the appropriate output.

If 17010331 is entered, 3/31/1701 would be the appropriate output.

In addition to pulling out the month, day, and year, you will need to validate the following prior to output:

  1. An 8-digit number is entered

Invalid input should result in an invalid length message

  1. The month is a valid month [1..12]

Invalid input should result in an invalid month message

  1. The day is valid [1..31]

Invalid input should result in an invalid day message

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 Databases Questions!