I agree that my if else statements are pretty convoluted but I was sure all the brackets and pairings within pairings matched up correctly yet I continue to get the error on visual studios that "illegal else without matching if".
I've looked over this so many, times I need a fresh pair of eyes to help me spot the problem:
bool isValidDate(int month, int day, int year) {
if (!isGregorianDate(month, day, year) || month > 12 || month < 1 || day > 31 || day < 1) {
return false;
}