From ba0dd474c23f6622a17d712351103fe2fd3792d2 Mon Sep 17 00:00:00 2001 From: Mohammadfazel Date: Fri, 24 Apr 2026 12:44:37 +0000 Subject: [PATCH] (fix): Readme updated based on comments --- README.md | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e54e0e5..47e937f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ This assignment consists of two separate parts. You must complete both parts. ## Part 1: Rational Class (Rational Numbers) In this part, you will implement a Rational class that supports basic mathematical operations. +A `RationalTest` class is provided. ++You can run it to verify that your implementation works correctly. ++Use it to test your logic before submitting. + Tasks: Define fields for numerator and denominator @@ -18,6 +22,8 @@ Implement addition, subtraction, multiplication, and division as instance method Implement addition, subtraction, multiplication, and division as static methods Note: Detailed TODO comments are provided inside Rational.java. +Do NOT modify the constructor, simplify logic, or completed methods. +Only complete the TODO methods. --- ## Part 2: Movie Explorer 🎬 (Using API) @@ -29,11 +35,20 @@ In this part, you will develop a Java application that fetches movie data from a - `MovieService.java` - `Main.java` +The `Genre` class is already implemented as a sample. +You must design and implement the `Movie` class yourself (fields, constructors, getters, setters, toString if needed). + We have already implemented two methods that call the API and return the raw JSON response as a `String`: - `getGenresList()` → calls the API and returns the list of genres in JSON format. - `getMoviesByGenreList(Long genreId, Long page)` → calls the API and returns the list of movies for a specific genre and page in JSON format. +Do NOT modify: + API URLs + `getGenresList()` + `getMoviesByGenreList()` + +Only complete the TODO methods. ### Your Tasks @@ -53,10 +68,14 @@ We have already implemented two methods that call the API and return the raw JSO - View the list of genres - Select a genre - View movies for the selected genre (with pagination) - +After completing `MovieService`, you must also complete the `Main` class +so the menu works correctly. ### Note To understand what fields should exist in the `Genre` and `Movie` classes, it is recommended that you first call the two API methods once and inspect the raw JSON response. This will help you determine the exact structure of the data and define the appropriate class fields. +We implemented JSON parsing using **Gson** in the project. +However, the **Jackson dependency is also included**. +If you prefer, you are allowed to use Jackson instead of Gson. --- ## Objectives ✏️ @@ -106,7 +125,7 @@ Understanding: You must be able to explain your implementation --- ## Bonus Tasks ✒️ -Parse the JSON returned by the `getMovieInfo` method into a MovieInfo entity, and then present the structured movie details based on the user‑provided movie ID. +Parse the JSON returned by `getMovieInfo` into a `MovieInfo` entity and display structured movie details based on user-provided movie ID. Advanced search (title, genre, year, rating, etc.) @@ -118,6 +137,23 @@ Improved console menu design GUI version using JavaFX +--- +## References 📚 + +API Base: + https://api.meshcomp.ir/api/v1/genres + +Video Tutorials (compressed versions): + https://drive.meshcomp.ir/d/a29a5f6ea6484834bcf0/ + +Gson Tutorial: +(Gson) Reading and Parsing Data from a JSONObject + https://drive.meshcomp.ir/f/e8dea01f31b24cbca152/ + +Jackson Tutorial: +(Jackson) Parsing Json in Java Tutorial - Part 1 Jackson and Simple Objects + https://drive.meshcomp.ir/f/005d8f8fc19a44f4927b/ + --- ## Submission ⌛ Deadline: May 1st (11 Ordibehesht)