Comp 170

Validate Date String

Due: 10/31/2005 at 9:50 am

Points: 20

 

Goals

  1. Practice parsing strings.
  2. Learn to convert strings to integers. atoi

Assignment

Write a c++ program with the following functionality.  Compile, run and verify your program.

           

  1. Your program should accept a line of text input.
  2. When the line contains a valid date display “Valid Date”.
  3. When the line contains an invalid date display “Invalid Date”.
  4. Be sure to check for leap years.  http://www.harding.edu/dsteil/170/flowcharts/leap year.htm
  5. The only date format that should be considered valid is mm/dd/yyyy.

 

Program Submission