CMPS-3350 Software Engineering
Lab-7

Step 1: Get started...

Do your work in your Odin /3350/7/ folder.
Log on to Odin, then do this...
$ cd 3350 $ ./lab-start.sh $ cd 7 $ cp /home/fac/gordon/p/3350/code/7/lab7.cpp .
Sample output of the starting program...
$ ./lab7 Calculate days between dates. Days between Mar 4, 2025 and Mar 4, 2025 is: 0 Days between Mar 4, 2025 and Mar 5, 2025 is: 1 Days between Mar 1, 2025 and Mar 31, 2025 is: 30 Days between Mar 1, 2025 and Apr 1, 2025 is: 4000000 <--- error Days between Jan 1, 2024 and Jan 1, 2025 is: 4000000 <--- error Days between Jan 1, 2025 and Jan 1, 2026 is: 4000000 <--- error Days between Mar 4, 2025 and Mar 2, 2025 is: 4000000 <--- error 4 errors occured.
To make this program work, modify the Date operator++() function. Modify the prefix increment operator for the Date class. Do not modify other functions except main().
How to know if a year is a leap-year ------------------------------------ To be a leap year, the year number must be divisible by four. Except for end-of-century years, which must be divisible by 400. An end-of-century year is divisible by 100. Not a leap year, unless it's also divible by 400. The year 2000 was a leap year. The year 1900 was not. How do you add a day to a leap-year? Good question. Answer: in the month of February.
You may write a function to test 2 dates to see which date comes first. This would be used when the first date is later than the second date. How will you handle this? Elements not allowed in this assignment --------------------------------------- 1. #include <chrono> 2. #include <ctime> 3. #include <date.h> 4. any new functions

Step 2: Add a test from the command-line...

Add a test to your program.

Sample output of a test...
$ ./lab7 03-01-2025 04-01-2025 Days between: 31
Files to be collected at 9:50am ------------------------------- 3350/7/lab7.cpp 3350/7/Makefile