I am trying to make a Coid-19 self-assessment tool and to determine how long the user should quarantine for the program needs to know their time they were exposed and the time they were given their second shot.
Currently I have exactly what I want my function file to look like but the issue is, how to subtract the stored date from 1/1/2021. I am passing the values from the function with pass by const reference.
//Include proper libraries
#include <iostream>
#include <cstdlib>
using namespace std;
//Include header files
#include "Date.h"
#include "CalcDays.h"
//Define function to calculate the ammount of time between exposure and users second shot
int calcDays(const Date& constRefDate1, const Date& constRefDate2) {
//Define local var
int daysDiff1;
int daysDiff2;
//Calculate the difference between daysDiff and 1/1/2021
daysDiff1 = constRefDate1 -
daysDiff2 = constRefDate2 -
//Return the difference between date exposed and date you have gotten the shot
return abs(daysDiff1-daysDiff2);
}