Ap Csa 2019 Frq 1 Apcalendar

FRQ Archive2019 FRQs › FRQ 1: APCalendar
2019 AP CSA • Methods & Control Structures

AP CSA 2019 FRQ 1: APCalendar

Complete solution, scoring rubric, and walkthrough — verified from the official College Board PDF

9 Points Medium Units 1 & 2
Question Type Methods & Control Structures
Skills Tested Static method calls, loop with helper call, modulo arithmetic, day-of-week formula
Difficulty Medium
Recommended Time 22 minutes

What This Problem Asks

2019 AP CSA FRQ 1 APCalendar asks students to write two static methods. numberOfLeapYears counts leap years between year1 and year2 using the provided isLeapYear helper. dayOfWeek uses firstDayOfYear and dayOfYear with the formula (firstDay + dayNum - 1) % 7.

What This FRQ Tests

This FRQ tests Unit 1 (calling static helper methods) and Unit 2 (loops, modulo operator).

Official Question & PDF

Download Full FRQ PDF →

PDF cannot display on this device. Open PDF directly →

Timer 22:00

Provided Code

public class APCalendar
{
    private static boolean isLeapYear(int year) { /* not shown */ }
        public static int numberOfLeapYears(int year1, int year2) {
        /* part (a) */
    }
    private static int firstDayOfYear(int year) { /* not shown */ }
    private static int dayOfYear(int month, int day, int year) { /* not shown */ }
        public static int dayOfWeek(int month, int day, int year) {
        /* part (b) */
    }
}

Part A — 4 Points

Write numberOfLeapYears: return the count of leap years between year1 and year2 inclusive, using isLeapYear.

Write Your Solution

Drag corner to expand ▽

Scoring Rubric (Part A — 4 points)

+1 Loops from year1 through year2 inclusive
+1 Calls isLeapYear in the context of the loop
+1 Counts the number of leap years
+1 Returns the correct count

Solution

public static int numberOfLeapYears(int year1, int year2)
{
    int count = 0;
    for (int year = year1; year <= year2; year++)
    {
        if (isLeapYear(year))
        {
            count++;
        }
    }
    return count;
}

Part B — 5 Points

Write dayOfWeek: return the day of week (0=Sunday, 6=Saturday) for the given date, using firstDayOfYear and dayOfYear.

Write Your Solution

Drag corner to expand ▽

Scoring Rubric (Part B — 5 points)

+1 Calls firstDayOfYear(year)
+1 Calls dayOfYear(month, day, year)
+1 Uses correct formula combining first day and day of year
+1 Uses modulo 7 to get day of week in range 0–6
+1 Returns the correct day of week (algorithm)

Solution

public static int dayOfWeek(int month, int day, int year)
{
    int firstDay = firstDayOfYear(year);
    int dayNum = dayOfYear(month, day, year);
    return (firstDay + dayNum - 1) % 7;
}
The formula: firstDayOfYear gives the day-of-week for Jan 1. dayOfYear gives how many days into the year the date is (Jan 1 = day 1). The day of week = (firstDay + dayNum - 1) % 7. The -1 accounts for Jan 1 being day 1 (not day 0).

Common Mistakes to Avoid

Off-by-one in dayOfWeek formula

dayOfYear returns 1 for January 1 (not 0). The formula must subtract 1: (firstDay + dayNum - 1) % 7. Without the -1, January 1 would give (firstDay + 1) % 7 which is wrong.

Exam Tips

The -1 in the dayOfWeek formula is the critical off-by-one to remember: dayOfYear returns 1 for Jan 1, not 0.
Part A is a simple loop + helper call. It's the easiest of the two parts. Focus time on the formula for Part B.

Scoring Summary

Part Method Points
Part A Write 4
Part B Write 5
Total 9

Want the Complete 2019 FRQ Solutions?

Browse all past AP CSA FRQs with full solutions and scoring breakdowns.

FRQ Archive →

Related FRQs

Methods & Control Structures 2023 FRQ 1: AppointmentBook — Consecutive-block scheduling algorithm Methods & Control Structures 2018 FRQ 1: FrogSimulation — Loop with three termination conditions

Study the Concepts

Unit 1 Study Guide → Unit 2 Study Guide →

Struggling with FRQs? Get 1-on-1 Help

Work directly with Tanner — AP CS teacher with 11+ years experience and 1,845+ verified tutoring hours. 54.5% of students score 5s (vs. 25.5% national average).

5.0Rating (451+ reviews)
1,845+Verified Hours
54.5%Score 5s

Book a Session ($150/hr) →

5-session packages at $125/hr. Venmo, Zelle, PayPal, or credit card.

Frequently Asked Questions

What does 2019 AP CSA FRQ 1 APCalendar test?

FRQ 1 tests static method calls with helper functions. numberOfLeapYears loops year1 to year2 counting isLeapYear calls. dayOfWeek uses a formula combining firstDayOfYear and dayOfYear with modulo 7.

How many points is 2019 FRQ 1 worth?

9 points: 4 for Part A (numberOfLeapYears) and 5 for Part B (dayOfWeek).

What is the formula for dayOfWeek?

(firstDayOfYear(year) + dayOfYear(month, day, year) - 1) % 7. The -1 is because dayOfYear returns 1 for January 1 (not 0).

Why use static methods here?

APCalendar uses all static methods (no instance needed) for calendar calculations. Static is appropriate when methods don't depend on any object state.

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]