// Prototype Implementation

public class APCalendar {

    /** Returns true if year is a leap year and false otherwise.
     * isLeapYear(2019) returns False
     * isLeapYear(2016) returns True
     */          
    private static boolean isLeapYear(int year) {
        // implementation not shown

        boolean isLeapYear = ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0));

        if(isLeapYear){

            return true;
        }

        else{

        
        return false;
        }



        }
        
    /** Returns the value representing the day of the week 
     * 0 denotes Sunday, 
     * 1 denotes Monday, ..., 
     * 6 denotes Saturday. 
     * firstDayOfYear(2019) returns 2 for Tuesday.
    */
    private static int firstDayOfYear(int year) {
        // implementation not shown

        return 0;
        }


    /** Returns n, where month, day, and year specify the nth day of the year.
     * This method accounts for whether year is a leap year. 
     * dayOfYear(1, 1, 2019) return 1
     * dayOfYear(3, 1, 2017) returns 60, since 2017 is not a leap year
     * dayOfYear(3, 1, 2016) returns 61, since 2016 is a leap year. 
    */ 
    private static int dayOfYear(int month, int day, int year) {
        // implementation not shown
       
        int[] a = {31, 29, 31, 30, 31, 30, 31, 30,31 30, 30, 31 };
        int[] b = {31, 28, 31, 30, 31, 30, 31, 30,31 30, 30, 31 };

        if(isLeapYear(year)=true;){

            for (int i = 0; i < month-1; i++) {
  
                // Array.getInt method
                int x = day;
                
                x+=Array.getInt(a, i);
              

           
        }
        System.out.println("This is not a leap year");
    }

       

        else{

            for (int i = 0; i < month-1; i++) {
  
                // Array.getInt method
                int x = day;
                
                x+=Array.getInt(b, i);
              

           
        }


            System.out.println("This is a leap year");


        }

        System.out.println(x);


        return 1;
        }

    /** Returns the number of leap years between year1 and year2, inclusive.
     * Precondition: 0 <= year1 <= year2
    */ 
    public static int numberOfLeapYears(int year1, int year2) {
         // to be implemented in part (a)
         int num=0;
         
         for (int i=year1; i<=year2; i++)
         {

            if(isLeapYear(i)){
          num++;


            }
         }

        return num;
       
        }

    /** Returns the value representing the day of the week for the given date
     * Precondition: The date represented by month, day, year is a valid date.
    */
    public static int dayOfWeek(int month, int day, int year) { 
        // to be implemented in part (b)
        return 0;
        }

    /** Tester method */
    public static void main(String[] args) {
        // Private access modifiers
        System.out.println("isLeapYear: " + APCalendar.isLeapYear(2020));
        System.out.println("firstDayOfYear: " + APCalendar.firstDayOfYear(2022));
        System.out.println("dayOfYear: " + APCalendar.dayOfYear(1, 1, 2022));

        // Public access modifiers
        System.out.println("numberOfLeapYears: " + APCalendar.numberOfLeapYears(2019, 2021));
        System.out.println("dayOfWeek: " + APCalendar.dayOfWeek(1, 1, 2022));
    }

}

APCalendar.main(null)
|           int[] a = {31, 29, 31, 30, 31, 30, 31, 30,31 30, 30, 31 };
'}' expected

|           int[] b = {31, 28, 31, 30, 31, 30, 31, 30,31 30, 30, 31 };
'}' expected
public class Book {
    private String title;
    private int id;
    private static int bookCount = 0;
    // One-argument constructor for title
    public Book(String title) {
        this.title = title;
        this.id = ++bookCount;
    }
    // Getter for BookCount
    public static int getBookCount() {
        return bookCount;
    }
    // Override toString() method to return title
    @Override
    public String toString() {
        return this.title;
    }
    public static void main(String[] args) {
        Book book1 = new Book(Boy With The Striped Pajamas);
        Book book2 = new Book(Refugee);
        System.out.println(Book 1 ID:  + book1.id);
        System.out.println(Book 1 Title:  + book1.toString());
        System.out.println(Book 2 ID:  + book2.id);
        System.out.println(Book 2 Title:  + book2.toString());
        System.out.println(Total books in library:  + Book.getBookCount());
    }
}
Book.main(null);
|           Book book1 = new Book(“Boy With The Striped Pajamas”);
illegal character: '\u201c'

|           Book book1 = new Book(“Boy With The Striped Pajamas”);
';' expected

|           Book book1 = new Book(“Boy With The Striped Pajamas”);
';' expected

|           Book book1 = new Book(“Boy With The Striped Pajamas”);
illegal character: '\u201d'

|           Book book1 = new Book(“Boy With The Striped Pajamas”);
not a statement

|           Book book2 = new Book(“Refugee”);
illegal character: '\u201c'

|           Book book2 = new Book(“Refugee”);
illegal character: '\u201d'

|           Book book2 = new Book(“Refugee”);
not a statement

|           System.out.println(“Book 1 ID: ” + book1.id);
illegal character: '\u201c'

|           System.out.println(“Book 1 ID: ” + book1.id);
not a statement

|           System.out.println(“Book 1 ID: ” + book1.id);
';' expected

|           System.out.println(“Book 1 ID: ” + book1.id);
illegal character: '\u201d'

|           System.out.println(“Book 1 ID: ” + book1.id);
not a statement

|           System.out.println(“Book 1 ID: ” + book1.id);
';' expected

|           System.out.println(“Book 1 Title: ” + book1.toString());
illegal character: '\u201c'

|           System.out.println(“Book 1 Title: ” + book1.toString());
not a statement

|           System.out.println(“Book 1 Title: ” + book1.toString());
';' expected

|           System.out.println(“Book 1 Title: ” + book1.toString());
illegal character: '\u201d'

|           System.out.println(“Book 1 Title: ” + book1.toString());
';' expected

|           System.out.println(“Book 2 ID: ” + book2.id);
illegal character: '\u201c'

|           System.out.println(“Book 2 ID: ” + book2.id);
not a statement

|           System.out.println(“Book 2 ID: ” + book2.id);
';' expected

|           System.out.println(“Book 2 ID: ” + book2.id);
illegal character: '\u201d'

|           System.out.println(“Book 2 ID: ” + book2.id);
not a statement

|           System.out.println(“Book 2 ID: ” + book2.id);
';' expected

|           System.out.println(“Book 2 Title: ” + book2.toString());
illegal character: '\u201c'

|           System.out.println(“Book 2 Title: ” + book2.toString());
not a statement

|           System.out.println(“Book 2 Title: ” + book2.toString());
';' expected

|           System.out.println(“Book 2 Title: ” + book2.toString());
illegal character: '\u201d'

|           System.out.println(“Book 2 Title: ” + book2.toString());
';' expected

|           System.out.println(“Total books in library: ” + Book.getBookCount());
illegal character: '\u201c'

|           System.out.println(“Total books in library: ” + Book.getBookCount());
';' expected

|           System.out.println(“Total books in library: ” + Book.getBookCount());
';' expected

|           System.out.println(“Total books in library: ” + Book.getBookCount());
illegal character: '\u201d'

|           System.out.println(“Total books in library: ” + Book.getBookCount());
';' expected