Supermarket Managemet System/main.cpp
bool CompareUsingExpirationDateDescending( Product FirstProduct, Product SecondProduct)
{
    if((FirstProduct.ExpireDate.Year > SecondProduct.ExpireDate.Year)||((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&(FirstProduct.ExpireDate.Month > SecondProduct.ExpireDate.Month))||(((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&(FirstProduct.ExpireDate.Month == SecondProduct.ExpireDate.Month))&&(FirstProduct.ExpireDate.Day > SecondProduct.ExpireDate.Day)))
        return 1;
    else
        return 0;
}
//Used to Compare products using there expiration date in descending order
Used to Compare products using there expiration date in descending order
Used to Compare products using there expiration date in descending order
bool CompareUsingExpirationDateDescending( Product FirstProduct, Product SecondProduct)
{
    if((FirstProduct.ExpireDate.Year > SecondProduct.ExpireDate.Year)||((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&(FirstProduct.ExpireDate.Month > SecondProduct.ExpireDate.Month))||(((FirstProduct.ExpireDate.Year == SecondProduct.ExpireDate.Year)&&(FirstProduct.ExpireDate.Month == SecondProduct.ExpireDate.Month))&&(FirstProduct.ExpireDate.Day > SecondProduct.ExpireDate.Day)))
        return 1;
    else
        return 0;
}
bool CompareUsingExpirationDateDescending ( Product FirstProduct , Product SecondProduct ) { if ( ( FirstProduct . ExpireDate . Year > SecondProduct . ExpireDate . Year ) || ( ( FirstProduct . ExpireDate . Year == SecondProduct . ExpireDate . Year ) && ( FirstProduct . ExpireDate . Month > SecondProduct . ExpireDate . Month ) ) || ( ( ( FirstProduct . ExpireDate . Year == SecondProduct . ExpireDate . Year ) && ( FirstProduct . ExpireDate . Month == SecondProduct . ExpireDate . Month ) ) && ( FirstProduct . ExpireDate . Day > SecondProduct . ExpireDate . Day ) ) ) return 1 ; else return 0 ; }
Used to Compare products using there expiration date in descending order
Used to Compare products using there expiration date in descending order