From d82a27d63d1b9153cc149aa764d5b9a9c1e5d057 Mon Sep 17 00:00:00 2001 From: Kiana Ghamsari Date: Fri, 17 Mar 2023 23:22:43 +0330 Subject: [PATCH 1/2] Done --- src/main/java/org/example/Main.java | 240 +++++++++++++++++- src/main/java/org/example/Movie.java | 25 +- src/main/java/org/example/NetflixService.java | 117 ++++++++- src/main/java/org/example/TVShow.java | 76 ++++++ src/main/java/org/example/User.java | 177 ++++++++++++- 5 files changed, 620 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/example/Main.java b/src/main/java/org/example/Main.java index 0718b5a..76c09cb 100644 --- a/src/main/java/org/example/Main.java +++ b/src/main/java/org/example/Main.java @@ -1,14 +1,248 @@ package org.example; +import java.util.ArrayList; + +import javax.swing.*; + public class Main { //don't limit yourself to our template *** - + static NetflixService netflixService = new NetflixService(); public static void main(String[] args) { - + shows(); + runMenu(); } public static void runMenu(){ - //TODO: + while(true) { + String username = JOptionPane.showInputDialog(null, "NETFLIX\n*****Netflix - Watch TV Shows Online, Watch Movies Online*****\nReady to watch? Enter a username to create or restart your membership."); + if (username == null) { + break; + } else { + if (netflixService.doesUserExist(username)) { // login + String password = JOptionPane.showInputDialog(null, "Hello " + username + "!\nPlease enter your password: "); + if(netflixService.login(username, password)) { + String userMenuOption = JOptionPane.showInputDialog(null, "Welcome to your page " + username + "!" + "\nWhat would you like to do?\n" + displayUserMenu()); + switch (userMenuOption) { + case "1": // Watch a Show + String watchOption_title = JOptionPane.showInputDialog(null, "Enter the Title of the show you want to watch: "); + if (!netflixService.searchByTitle(watchOption_title).isEmpty()) { + JOptionPane.showMessageDialog(null, "Let's watch " + netflixService.searchByTitle(watchOption_title).get(0)); + netflixService.getUser().watchAShow(netflixService.searchByTitle(watchOption_title).get(0)); + } else { + JOptionPane.showMessageDialog(null, "Nothing Found!"); + } + break; + case "2": // Get Recommendations + JOptionPane.showMessageDialog(null, "Recommended TVShows and movies: \n" + netflixService.getUser().getRecommendations(netflixService.getTvShows())); + break; + case "3": // View Favorites + String searchOption_Favorites = JOptionPane.showInputDialog(null, "Search By: \n" + searchShowsList()); + switch (searchOption_Favorites) { + case "1": // Search By a Title in Favorites + String title = JOptionPane.showInputDialog(null, "Enter the Title: "); + if(netflixService.getUser().searchByTitle(title).isEmpty()) + JOptionPane.showMessageDialog(null, "Nothing Found!"); + else + JOptionPane.showMessageDialog(null, netflixService.getUser().searchByTitle(title)); + netflixService.getUser().viewFavorites(); + break; + case "2": // Search By a Genre in Favorites + String genre = JOptionPane.showInputDialog(null, "Enter the Genre: "); + if(netflixService.getUser().searchByGenre(genre).isEmpty()) + JOptionPane.showMessageDialog(null, "Nothing Found!"); + else + JOptionPane.showMessageDialog(null, netflixService.getUser().searchByGenre(genre)); + netflixService.getUser().viewFavorites(); + break; + case "3": // Search By a Release Year in Favorites + String releaseYear = JOptionPane.showInputDialog(null, "Enter the Release Year: "); + if(netflixService.getUser().searchByReleaseYear(Integer.parseInt(releaseYear)).isEmpty()) + JOptionPane.showMessageDialog(null, "Nothing Found!"); + else + JOptionPane.showMessageDialog(null, netflixService.getUser().searchByReleaseYear(Integer.parseInt(releaseYear))); + netflixService.getUser().viewFavorites(); + break; + + default: + runMenu(); + break; + } + break; + case "4": // Search Shows + String searchOption_all = JOptionPane.showInputDialog(null, "Search By: \n" + searchShowsList()); + switch (searchOption_all) { + case "1": // Search By a Title + String title = JOptionPane.showInputDialog(null, "Enter the Title: "); + if(netflixService.searchByTitle(title).isEmpty()) + JOptionPane.showMessageDialog(null, "Nothing Found!"); + else + JOptionPane.showMessageDialog(null, netflixService.searchByTitle(title)); + break; + case "2": // Search By a Genre + String genre = JOptionPane.showInputDialog(null, "Enter the Genre: "); + if(netflixService.searchByGenre(genre).isEmpty()) + JOptionPane.showMessageDialog(null, "Nothing Found!"); + else + JOptionPane.showMessageDialog(null, netflixService.searchByGenre(genre)); + break; + case "3": // Search By a Release Year + String releaseYear = JOptionPane.showInputDialog(null, "Enter the Release Year: "); + if(netflixService.searchByReleaseYear(Integer.parseInt(releaseYear)).isEmpty()) + JOptionPane.showMessageDialog(null, "Nothing Found!"); + else + JOptionPane.showMessageDialog(null, netflixService.searchByReleaseYear(Integer.parseInt(releaseYear))); + break; + default: + runMenu(); + break; + } + break; + case "5": // Add Shows + String addOption = JOptionPane.showInputDialog(null, "Add To: \n" + addShowsList()); + switch (addOption) { + case "1": // Add to Your Favorites + String titleAddToFavorites = JOptionPane.showInputDialog(null, "Enter a Title to add to your Favorites: \n"); + if (!netflixService.searchByTitle(titleAddToFavorites).isEmpty()) { + JOptionPane.showMessageDialog(null, "Let's add " + netflixService.searchByTitle(titleAddToFavorites).get(0)); + netflixService.getUser().addToFavorites(netflixService.searchByTitle(titleAddToFavorites).get(0)); + } else { + JOptionPane.showMessageDialog(null, "Nothing Found!"); + } + + break; + case "2": // Add to Your Watch Later + String titleAddToWatchLater = JOptionPane.showInputDialog(null, "Enter a Title to add to your Watch Later: \n"); + if (!netflixService.searchByTitle(titleAddToWatchLater).isEmpty()) { + JOptionPane.showMessageDialog(null, "Let's add " + netflixService.searchByTitle(titleAddToWatchLater).get(0)); + netflixService.getUser().addToWatchLater(netflixService.searchByTitle(titleAddToWatchLater).get(0)); + } else { + JOptionPane.showMessageDialog(null, "Nothing Found!"); + } + break; + default: + runMenu(); + break; + } + break; + case "6": // Log Out + netflixService.logout(); + runMenu(); + break; + default: + runMenu(); + break; + } + } else { + JOptionPane.showMessageDialog(null, "The username & password you entered do not match. Please try again "); + runMenu(); + } + } else { // sign up + String createdPassword = JOptionPane.showInputDialog(null, "Welcome " + username + "!\nLet's create an account.\nEnter a password: "); + netflixService.createAccount(username, createdPassword); + runMenu(); + } + } + } + } + + public static String displayUserMenu() { + return "1: Watch a Show\n2: Get Recommendations\n3: View Favorites\n4: Search Shows\n5: Add Shows\n6: Log Out"; + } + + public static String searchShowsList() { + return "1: Search by a Title\n2: Search by a Genre\n3: Search by a Release Year"; + } + + public static String addShowsList() { + return "1: Add to Your Favorites\n2: Add to Your Watch Later"; + } + + public static void shows() { + + ArrayList cast1 = new ArrayList<>(); + cast1.add("Kit Harington"); + cast1.add("Richard Madden"); + cast1.add("Peter Dinklage"); + TVShow tvShow1 = new TVShow("Game of Thrones", "Action, Adventure, Drama", 2011, 55, 9.2, cast1); + + ArrayList cast2 = new ArrayList<>(); + cast2.add("Bryan Cranston"); + cast2.add("Aaron Paul"); + TVShow tvShow2 = new TVShow("Breaking bad","Drama",2008,50,9.5,cast2); + + ArrayList cast3 = new ArrayList<>(); + cast3.add("Alvaro Morte"); + cast3.add("Ursula Corbero"); + cast3.add("Itziar Ituno"); + TVShow tvShow3 = new TVShow("Money Heist", "Crime", 2017, 41, 9.4, cast3); + + ArrayList cast4 = new ArrayList<>(); + cast4.add("Cillian Murphy"); + cast4.add("Joe Cole"); + cast4.add("Annabelle Wallis"); + TVShow tvShow4 = new TVShow("Peaky Blinders","Drama",2013,60,8.8,cast4); + + ArrayList cast5 = new ArrayList<>(); + cast5.add("Tom Hiddleston"); + cast5.add("Sophia Di Martino"); + TVShow tvShow5 = new TVShow("Loki", "Action, Adventure, Fantasy", 2021, 3, 8.2, cast5); + + ArrayList cast6 = new ArrayList<>(); + cast6.add("Justin Roiland"); + cast6.add("Spencer Grammer"); + TVShow tvShow6 = new TVShow("Rick and Morty","Animation-Adventure-Comedy",2013,23,9.1,cast6); + + ArrayList cast7 = new ArrayList<>(); + cast7.add("Ali Hemmat Momivand"); + cast7.add("Bijan Alimohamadi"); + cast7.add("Shahrooz Malek Arayi"); + TVShow tvShow7 = new TVShow("The Heroes", "Animation, Drama, History", 2008, 34, 10, cast7); + + ArrayList castM1 = new ArrayList<>(); + castM1.add("Robert Downey Jr."); + castM1.add("Sebastian Stan"); + castM1.add("Elizabeth Olsen"); + TVShow movie1 = new Movie("Avengers: Infinity war","Adventure, Action",2018,149,8.5,castM1,149); + + ArrayList castM2 = new ArrayList<>(); + castM2.add("Chris Evans"); + castM2.add("Scarlett Johansson"); + castM2.add("Chris Hemsworth"); + TVShow movie2 = new Movie("Avengers: Endgame","Action, Adventure, Drama",2019,181,8.4, castM2,181); + + ArrayList castM3 = new ArrayList<>(); + castM3.add("Chris Evans"); + castM3.add("Robert Downey Jr."); + castM3.add("Sebastian Stan"); + TVShow movie3 = new Movie("Captain America: Civil War","Action, Sci-Fi",2016,146,7.8, castM3,146); + + ArrayList castM4 = new ArrayList<>(); + castM4.add("Matthew McConaughey"); + castM4.add("Jessica Chastain"); + castM4.add("Timothée Chalamet"); + TVShow movie4 = new Movie("Interstellar","Adventure-Drama",2014,169,8.6, castM4,169); + + ArrayList castM5 = new ArrayList<>(); + castM5.add("Leonardo DiCaprio"); + castM5.add("Tom Hardy"); + castM5.add("Cillian Murphy"); + TVShow movie5 = new Movie("Inception","Action-Adventure",2010,148,8.8,castM5,148); + + + + netflixService.addTVShow(tvShow1); + netflixService.addTVShow(tvShow2); + netflixService.addTVShow(tvShow3); + netflixService.addTVShow(tvShow4); + netflixService.addTVShow(tvShow5); + netflixService.addTVShow(tvShow6); + netflixService.addTVShow(tvShow7); + netflixService.addTVShow(movie1); + netflixService.addTVShow(movie2); + netflixService.addTVShow(movie3); + netflixService.addTVShow(movie4); + netflixService.addTVShow(movie5); + } } diff --git a/src/main/java/org/example/Movie.java b/src/main/java/org/example/Movie.java index 081ba70..aa256db 100644 --- a/src/main/java/org/example/Movie.java +++ b/src/main/java/org/example/Movie.java @@ -6,8 +6,29 @@ class Movie extends TVShow { /* *Movie is extended from TVShow and has extra attribute length. */ - public Movie() - { + + private int length; // extra attribute + + + public Movie() { super(); } + + public Movie(String title, String genre, int releaseYear, int duration, double rating, ArrayList cast, int length) { + super(title, genre, releaseYear, duration, rating, cast); + this.length = length; + } + + public int getLength() { + return length; + } + + public void setLength(int length) { + this.length = length; + } + + @Override + public String toString() { + return super.toString() + "The Length: " + this.length; + } } diff --git a/src/main/java/org/example/NetflixService.java b/src/main/java/org/example/NetflixService.java index 5345a3e..a55fddf 100644 --- a/src/main/java/org/example/NetflixService.java +++ b/src/main/java/org/example/NetflixService.java @@ -1,6 +1,7 @@ package org.example; import java.util.ArrayList; +import javax.swing.*; class NetflixService { /* @@ -8,40 +9,148 @@ class NetflixService { *The NetflixService should have a User object which represents current user. */ + private ArrayList users = new ArrayList(); + private ArrayList tvShows = new ArrayList(); + private ArrayList movies = new ArrayList(); + private User user; + + public ArrayList getUsers() { + return users; + } + public void setUsers(ArrayList users) { + this.users = users; + } + + public ArrayList getTvShows() { + return tvShows; + } + public void setTvShows(ArrayList tvShows) { + this.tvShows = tvShows; + } + + public ArrayList getMovies() { + return movies; + } + public void setMovies(ArrayList movies) { + this.movies = movies; + } + + public User getUser() { + return this.user; + } + public void setUser(User user) { + this.user = user; + } + + public void addTVShow(TVShow tvShow){ // Implement add tv show logic here + if (!tvShows.contains(tvShow)) { + tvShows.add(tvShow); + JOptionPane.showMessageDialog(null, "The TV show \"" + tvShow.getTitle() + "\" has been successfully added."); + } else { + JOptionPane.showMessageDialog(null, "The TV show \"" + tvShow.getTitle() + "\" already exists."); + } } public void addMovie(Movie movie){ // Implement add movie logic here + if (!tvShows.contains(movie)) { + movies.add(movie); + JOptionPane.showMessageDialog(null, "The movie \"" + movie.getTitle() + "\" has been successfully added."); + } else { + JOptionPane.showMessageDialog(null, "The movie \"" + movie.getTitle() + "\" already exists."); + } + } + + public boolean doesUserExist(String username) { + for (User user : users) { + if (user.getUsername().equals(username)) + return true; + } + return false; } public void createAccount(String username, String password) { // Implement create account logic here + if (!doesUserExist(username)) { + User newUser = new User(username,password); + users.add(newUser); + JOptionPane.showMessageDialog(null,"Welcome \"" + username + "\"!\nYour account has been created successfully!"); + } else { + JOptionPane.showMessageDialog(null,"The username \"" + username + "\" already exists."); + } + } + + public boolean userIsAuthenticated(String username, String password) { + if (doesUserExist(username)) { + for (User user : users) { + if (user.getUsername().equalsIgnoreCase(username) && user.getPassword().equals(password)) + return true; + } + } + return false; } public boolean login(String username, String password) { // Implement login logic here - return false; + if (doesUserExist(username)) { + if (userIsAuthenticated(username, password)) { + this.user = new User(username, password); + return true; + } else { + JOptionPane.showMessageDialog(null, "The username & password you entered do not match. Please try again "); + return false; + } + } else { + JOptionPane.showInputDialog(null, "The username \"" + username + "\" doesn't exist to log in."); + return false; + } } public void logout() { // Implement logout logic here + JOptionPane.showMessageDialog(null, "Goodbye " + user.getUsername() + "!"); + user = null; } public ArrayList searchByTitle(String title) { // Implement search by title logic here - return null; + ArrayList searchByTitleList = new ArrayList(); + + for (TVShow tvShow : tvShows) { + if (tvShow.getTitle().contains(title)) { + searchByTitleList.add(tvShow); + } + } + + return searchByTitleList; } public ArrayList searchByGenre(String genre) { // Implement search by genre logic here - return null; + ArrayList searchByGenreList = new ArrayList(); + + for (TVShow tvShow : tvShows) { + if (tvShow.getGenre().contains(genre)) { + searchByGenreList.add(tvShow); + } + } + + return searchByGenreList; } public ArrayList searchByReleaseYear(int year) { // Implement search by release year logic here - return null; + ArrayList searchByReleaseYearList = new ArrayList(); + + for (TVShow tvShow : tvShows) { + if (tvShow.getReleaseYear() == year) { + searchByReleaseYearList.add(tvShow); + } + } + + return searchByReleaseYearList; } diff --git a/src/main/java/org/example/TVShow.java b/src/main/java/org/example/TVShow.java index 005c218..66943fb 100644 --- a/src/main/java/org/example/TVShow.java +++ b/src/main/java/org/example/TVShow.java @@ -8,4 +8,80 @@ class TVShow { *The TVShow should have an ArrayList of the cast. */ + private String title; + private String genre; + private int releaseYear; + private int duration; + private double rating; + private ArrayList cast = new ArrayList(); + + public TVShow() { + + } + + public TVShow(String title, String genre, int releaseYear, int duration, double rating, ArrayList cast) { + this.title = title; + this.genre = genre; + this.releaseYear = releaseYear; + this.duration = duration; + this.rating = rating; + this.cast = cast; + } + + + public String getTitle() { + return title; + } + public void setTitle(String title) { + this.title = title; + } + + public String getGenre() { + return genre; + } + public void setGenre(String genre) { + this.genre = genre; + } + + public int getReleaseYear() { + return releaseYear; + } + public void setReleaseYear(int releaseYear) { + this.releaseYear = releaseYear; + } + + public int getDuration() { + return duration; + } + public void setDuration(int duration) { + this.duration = duration; + } + + public double getRating() { + return rating; + } + public void setRating(int rating) { + this.rating = rating; + } + + public ArrayList getCast() { + return cast; + } + public void setCast(ArrayList cast) { + this.cast = cast; + } + + public String printCast() { + String castString = ""; + for (int i = 0; i < this.cast.size(); i++) { + castString += "* " + this.cast.get(i) + "\n"; + } + return castString; + } + + @Override + public String toString() { + return "\nHere is the information of the TV Show " + this.title + ":\nThe Title: " + this.title + "\nThe Genre: " + this.genre + "\nThe Release Year: " + this.releaseYear + "\nThe Duration: " + this.duration + "\nThe Rating: " + this.rating + "\nThe Cast:\n" + printCast(); + } + } diff --git a/src/main/java/org/example/User.java b/src/main/java/org/example/User.java index 538e12b..1730e80 100644 --- a/src/main/java/org/example/User.java +++ b/src/main/java/org/example/User.java @@ -1,6 +1,10 @@ package org.example; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +import javax.swing.*; class User { /* @@ -10,27 +14,188 @@ class User { * *** NOTE: All search functions in user are for searching in favorite shows *** */ + private String username; + private String password; + public ArrayList favoriteShows = new ArrayList(); + private ArrayList watchHistory = new ArrayList(); + private ArrayList watchLater = new ArrayList(); + + + public User() { + + } + + public User(String username, String password) { + this.username = username; + this.password = password; + } + + + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + public ArrayList getFavoriteShows() { + return favoriteShows; + } + public void setFavoriteShows(ArrayList favoriteShows) { + this.favoriteShows = favoriteShows; + } + + public ArrayList getWatchHistory() { + return watchHistory; + } + public void setWatchHistory(ArrayList watchHistory) { + this.watchHistory = watchHistory; + } + + public ArrayList getWatchLater() { + return watchLater; + } + public void setWatchLater(ArrayList watchLater) { + this.watchLater = watchLater; + } + public ArrayList searchByTitle(String title) { // Implement search by title in favorite shows logic here - return null; + ArrayList searchByTitleList = new ArrayList(); + + for (TVShow tvShow : this.favoriteShows) { + if (tvShow.getTitle().contains(title)) { + searchByTitleList.add(tvShow); + } + } + + return searchByTitleList; } + + public ArrayList searchByGenre(String genre) { // Implement search by genre in favorite shows logic here - return null; + ArrayList searchByGenreList = new ArrayList(); + + for (TVShow tvShow : this.favoriteShows) { + if (tvShow.getGenre().contains(genre)) { + searchByGenreList.add(tvShow); + } + } + + return searchByGenreList; } + + public ArrayList searchByReleaseYear(int year) { // Implement search by release year in favorite shows logic here - return null; + ArrayList searchByReleaseYearList = new ArrayList(); + + for (TVShow tvShow : this.favoriteShows) { + if (tvShow.getReleaseYear() == year) { + searchByReleaseYearList.add(tvShow); + } + } + + return searchByReleaseYearList; } + + public void addToFavorites(TVShow show) { // Implement add to favorites logic here + if (!this.getFavoriteShows().contains(show)) { + this.favoriteShows.add(show); + JOptionPane.showMessageDialog(null, "The show \"" + show.getTitle() + "\" added to your Favorites successfully!"); + } else { + JOptionPane.showMessageDialog(null, "The show \"" + show.getTitle() + "\" already exists."); + } } - public void viewFavorites() { + + + public ArrayList viewFavorites() { // Implement view favorites logic here + if (this.favoriteShows.isEmpty()) { + JOptionPane.showMessageDialog(null, "Nothing has been added to your Favorites."); + return null; + } else { + JOptionPane.showMessageDialog(null, "Your favorites: \n" + this.favoriteShows.toString()); + return this.favoriteShows; + } + } + + public ArrayList sortByRatings(ArrayList arrayList) { + arrayList.sort(Comparator.comparing(TVShow::getRating)); + return arrayList; } - public ArrayList getRecommendations() { + + public ArrayList reverseAnArrayList(ArrayList arrayList) { + Collections.reverse(arrayList); + return arrayList; + } + + public ArrayList getRecommendations(ArrayList tvShows) { // Implement get recommendations logic here - return null; + ArrayList recommendationsList = new ArrayList<>(); + int limit = 5; + if (tvShows.size() > limit) { + switch (this.favoriteShows.size()) { + case 0: + limit += 3; + break; + case 1: + recommendationsList.add(this.favoriteShows.get(0)); + limit += 2; + break; + case 2: + recommendationsList.add(this.favoriteShows.get(0)); + recommendationsList.add(this.favoriteShows.get(1)); + limit += 1; + break; + default: + recommendationsList.add(this.favoriteShows.get(0)); + recommendationsList.add(this.favoriteShows.get(1)); + recommendationsList.add(this.favoriteShows.get(2)); + break; + } + if (!watchHistory.isEmpty()) + recommendationsList.add(watchHistory.get(watchHistory.size()-1)); + else limit++; + + if (!watchLater.isEmpty()) + recommendationsList.add(watchLater.get(watchLater.size()-1)); + else limit++; + + for (int i = 0; i < limit; i++) { + recommendationsList.add(reverseAnArrayList(sortByRatings(tvShows)).get(i)); + } + return recommendationsList; + } else { + return reverseAnArrayList(sortByRatings(tvShows)); + } + + } + + public void watchAShow(TVShow show) { + watchHistory.add(show); + } + + public void addToWatchLater(TVShow show) { + if (!watchLater.contains(show)) { + watchLater.add(show); + JOptionPane.showMessageDialog(null, "The show \"" + show.getTitle() + "\" added to Watch Later!"); + } else { + JOptionPane.showMessageDialog(null, "The show \"" + show.getTitle() + "\" already exists in Watch Later."); + } + } + } + From 78fc694b83e80894cc30e4c0f470a8712bdc7c41 Mon Sep 17 00:00:00 2001 From: kianaghamsari <90266554+kianaghamsari@users.noreply.github.com> Date: Fri, 17 Mar 2023 23:25:57 +0330 Subject: [PATCH 2/2] Create Report.md --- Report.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Report.md diff --git a/Report.md b/Report.md new file mode 100644 index 0000000..2205ed2 --- /dev/null +++ b/Report.md @@ -0,0 +1,38 @@ +# 4th Assignment Report + +![](https://github.com/kianaghamsari/Second-Assignment/blob/develop/uni.png) + +## Kiana Ghamsari - 400222079 + + +# Introduction + +In this program, the simulation of Netflix has been created. +A user can sign up, log in, search for different TV shows or Movies, add shows to favorites, or watch later. The project recommends some shows to a user sorted by their rating. + + +The program includes 5 classes: +* User +* TVShow +* NetflixService +* Movie +* Main + +# Design and Implementation +Here, the details of these classes are provided: + +![Netflix](https://user-images.githubusercontent.com/90266554/226000477-f4b0a933-a22a-48bd-a657-fae74017b662.jpeg) + +In main: +* First, the user enters his username. If the entered username exists, the program asks for the password to log in. If it doesn't exist, it tries to sign up the new user +* After logging in, the main menu shows up which contains querying a show, seeing the list of recommendations and user's favorites. +* The user can search among either his favorite shows or all shows by title, genre, and release year. +* Adding a show to the users' watch later list is also possible. +* A GUI is also provided by Java Swing +* When the program starts, initial data is loaded. The data includes: title, genre, release year, duration, rating, cast +* class `Movie` is inherited from `TVShow` which contains one extra field: "length" + +# Conclusion + +* I experienced using inheritance and encapsulation +* I could have implemented a new class called "Cast" that contains actors and actresses and each show could contain a ManyToMany field to Cast class. So there could be a search option by the name of the cast