Part 1

When doing FRQ, can first write down steps of what we need, if statement? for loop? counter? Remember to initialize variable, like count, day, year... Make sure to return the right thing, return count instead of year.

public static int numberOfLeapYears (int year1, int year2){
    //check IF year 1 is leap year or not, if not check year 1 + 1, and so on (for loop + if statement)
    //year 1 should be less than year 2 (condition)
    //then add up all the leap years (count)

    //isLeapYear(year) returns true if year is a leap year and false otherwise. 

    int count = 0; //initialize count, count should be outside of the for loop
    for (int y = year1; y <= year2; y++) {  // for each year between year 1 and year 2
        if (isLeapYear(y)) {  //if y is leap year (using the isLeapYear() method)
            count++; //count plus 1
        }
    }
    return count; //return the total number of leap years
}

Part 2

// returns the integer value representing the day of the week for the given date (month, day, year), where 0 denotes Sunday, 1 denotes Monday, ..., and 6denotes Saturday
// two helper methods: firstDayOfYear(year), dayOfYear(month, day, year) 

public static int dayOfWeek (int month, int day, int year) { //remember to define data type
    int firstDay = firstDayOfYear(year); //return the int value representing the day of the week for the first day of year
    int nthDay = dayOfYear(month, day, year); //return n, where month, day, and year specify the nth day of the year 
    int returnDay = (nthDay + firstDay - 1) % 7; //return based on a 0-indexed array instead of the 1-based list of days, gives us the right day of the week
    //% 7 at the end takes care of keeping the value within the bounds of the day of week index
    return returnDay; //return