Question: In assignment 1 , you had your first experience with a big object-oriented project with multiple classes working together to solve a problem. In assignment

 In assignment 1 , you had your first experience with a
big object-oriented project with multiple classes working together to solve a problem.
In assignment 2, we're going to gain more experience with object-oriented paradigms
and look at how we can use objects to handle data. The
goal of Assignment 2 is to make a program that works as

In assignment 1 , you had your first experience with a big object-oriented project with multiple classes working together to solve a problem. In assignment 2, we're going to gain more experience with object-oriented paradigms and look at how we can use objects to handle data. The goal of Assignment 2 is to make a program that works as a movie diary, basically like an offline Letterboxd. Here is a class diagram for what you need to implement: A runner class (MovieDiaryRunner.java) is provided that may help you test these classes. You must write exactly the four classes above (Film, DiaryEntry, Library, and Diary). You may write additional methods or include additional fields in these classes if you find that helpful but you may not create any additional classes beyond these four. Film: - Constructors (4 pts): Constructors should have the following constraints. If a director isn't given, the film should be directed by Alan Smitthee by default The runtime cannot be negative The year must be after 1880 - getFormattedRuntime (2 pts): This should take the film's runtime (in minutes) and break it down into hours and minutes. Runtime of 125 would return " 2 hours 5 minutes" - addActor (2 pts): Adds an actor to the cast list of this film - toString (2 pt): Returns a human-readable String representation of this film. This representation doesn't need to include the case. "Paddington 2 (2014) directed by Paul King, 1 hour 44 minutes" DiaryEntry: - Constructors ( 6 pts): Constructors should have the following constraints. If a rating is passed, it must be 0,0.5. 1,1.5,2,2.5,3,3.5,4,4.5, or 5 If a rating isn't passed, default to 1, which we'll use to indicate no rating. - toString (1 pt): Returns a human-readable String representation of this diary entry. Should include the name of the film, year of release, rating, and date of diary entry - toCSV(3 pts): Returns a String representation of this diary entry as if it were in a CSV file. Must match this exact format: Name, (Release) Year, Rating, Date "Paddington 2, 2014, 5, 2023-28-02" Library: - Constructor (10 pts): Take in the filename of the library esv file (see example library.csv on Canvas). In this constructor, read in every line of that file as the Film objects that make up your library and store them in the field, films. - getFilm (5 pts): Searches through the films in this library and returns the first film object with exactly this name and release year. If it. can't find it, return null. Diary: - Constructor (10 pt): Take in the filename of the diary esv (see example diary.csv on Canvas). In this constructor, read in every line of that file as the DiaryEntry objects that make up your Diary and store them in the field, logs. Ignore any logs for films that aren't in the library. - logFilm (5 pt): Creates a diary entry and adds it to the logs. - getMostloggedDirectors (4 pts): Return a list of the top 10 (fewer than 10 if there are fewer than 10 directors' films logged in the diary) most logged directors by simple frequency. Should be in ranked (descending) order. - getMostLoggedActors (4 pts): Return a list of the top 10 (fewer than 10 if there are fewer than 10 actors' films logsed in the diary) most logged actors by simple frequency. Should be in ranked (descending) order. - getHighestRatedDirectors (4 pts): Returns a list of the top 10 (fewer than 10 if necessary) highest rated directors based on average rating per diary entry per director. Should be in ranked (descending) order. Remember to not include films that were not given a rating, since that could throw off your average ratings. - getHighest RatedByReleaseYear (4 pts): Returns a list of the top 10 (fewer if needed) highest rated films that came out the year that was passed as parameter. Should be in ranked (descending) order. Remember to not include films that were not given a rating, since that could throw off your average ratings. - getRecentLogs (4 pts): Returns a list of the five most recent diary entries in logs. This list. must be String representations of these diary entries, not the diary entries themselves. 3. Add getters and setters for all properties in all classes (5 pts). Getters and setters are not included in the diagram and they are assumed. Use your best judgment as to which fields should get getters or setters and which should not. Film - filmName: String - year: int - runtime: int - director: String + actors: String[] + Film(String filmName, int year, int runtime) + Film(String fimname, int year, int runtime, String director) - getFormattedRuntime(): String + addActor(String actorName): void + toString(): String - DiaryEntry - film: Film - rating: double - date: LocalDate + DiaryEntry(Film film) + DiaryEntry(Fllm film, double rating) + DiaryEntry(Film film, LocalDate date) + DiaryEntry(Film film, double rating, LocalDate date) + toString(): String + tocSV(); String \begin{tabular}{l} Diary \\ \hline - logs: ArrayList \\ + Diary(String fileName, Library library) \\ + logFilm(DiaryEntry log) \\ + log Film(Film film, double rating. LocalDate date) \\ + logFim (Film film, LocalDate date) \\ + logFIIm(Film film, double rating) \\ + logFilm(Film film) \\ + getMostLoggedDirectors(): String[] \\ + getMostLoggedActors(): String[ \\ + getHighestRatedDirectors(): String[] \\ + getHighestRatedByReleaseYear(int year): String[] \\ + getRecentLogs(): String[] \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!