Draw a flowchart for a program that reads a date in an 8-digit sequence (month, day, year) and determines if the date is a valid date. ignore leap year. Assume Feb has 28 days, and establish a table of days in a month so that you can access the appropriate month to determine the correct number of days in a month. Extra credit: add a leap year module to the flowchart, so that the flowchart determines when a leap year occurs and changes to allow feb to have 29 days

Help this too!

Here is a flowchart that illustrates a program to determine whether a given date is valid or not, considering leap years for February:

```
START

Input date (8-digit sequence)

Extract month from date
Extract day from date
Extract year from date

Check if month is between 1 and 12 (inclusive)
IF month is NOT valid
Print "Invalid month"
STOP

Check if day is valid for the given month
IF day is NOT valid
Print "Invalid day"
STOP

Check if year is a leap year
IF year is a leap year AND month is 2 (February)
Check if day is between 1 and 29 (inclusive)
IF day is NOT valid
Print "Invalid day"
STOP
ELSE
Check if day is between 1 and the appropriate number of days for the given month
IF day is NOT valid
Print "Invalid day"
STOP

Print "Valid date"

STOP

```

To determine if a year is a leap year, you can use the following rules:
- If the year is divisible by 4, it is a leap year.
- However, if the year is divisible by 100, it is not a leap year, unless it is also divisible by 400.

To implement the leap year module in the flowchart, you can add the following steps:

```
Check if year is divisible by 4
IF year is NOT divisible by 4
It is NOT a leap year
ELSE
Check if year is divisible by 100
IF year is divisible by 100 AND NOT divisible by 400
It is NOT a leap year
ELSE
It is a leap year
```

Insert this block of steps before the check for the month being February (month = 2) in the flowchart.