Java Editor

AP Computer Science A FRQ: Library System

A public library keeps track of the books that it owns. Each book has a title, an author, a year of publication, and a number of times it has been borrowed.

You will design several classes to help manage the books in the library. You may assume that no two books have the exact same title and author combination.

Part A – The Book Class

Part B – The Library Class

Part C – Borrow Statistics

Add getBorrowStats() method to Library:

Map<String, Integer> getBorrowStats()

Returns total times borrowed per author.

Part D – Sorting by Popularity

Write printBooksByPopularity() that prints all books in descending borrow count using toString().

You may use a custom Comparator or implement Comparable.


AP Computer Science A FRQ: Student Grades System

A school system tracks students and their grades. Each student has a name, a list of test scores, and a method for calculating their average.

Part A – The Student Class

Part B – The Gradebook Class

Part C – Grade Report

Add a method printGradeReport() to Gradebook that prints each student's name, scores, and average in a formatted report.