Files
HW-03-oop-and-api-T/README.md
T
2026-04-23 10:37:58 +00:00

116 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Third Assignment: Movie Explorer 🎬 + Rational Calculator 🧮
---
Welcome to Your Third Assignment in the Advanced Programming Course!
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.
Tasks:
Define fields for numerator and denominator
Implement addition, subtraction, multiplication, and division as instance methods
Implement addition, subtraction, multiplication, and division as static methods
Note: Detailed TODO comments are provided inside Rational.java.
---
## Part 2: Movie Explorer 🎬 (Using API)
In this part, you will develop a Java application that fetches movie data from an API and allows users to browse and search movies.
Files Provided:
Movie.java
Genre.java
MovieService.java
Main.java
Tasks:
Complete the Movie class (fields, constructor, getters/setters)
Complete the Genre class (fields, constructor, getters/setters)
Parse JSON data from getGenresList() into a list of Genre objects
Display the list of genres to the user
Fetch and return a list of movies by genreId and page number
Display the genres of a specific movie
Implement a console menu in Main to receive user input and display data
Note: Detailed TODO comments are provided inside each of the above source files.
---
## Objectives ✏️
By completing this assignment, you will:
Reinforce OOP concepts: class design, constructors, encapsulation, collections
Practice instance methods vs. static methods
Work with JSON parsing and REST APIs
Design a simple console-based menu
Improve Git workflow and project management
----
## Prerequisites ✅
Git
Java (version 23 or 25)
Maven as a package manager
---
## Tasks Summary 📝
Fork the repository and clone it locally
Create and switch to a development branch
Complete Part 1 (Rational.java) following the TODO comments
Complete Part 2 (Movie.java, Genre.java, MovieService.java, Main.java) following the TODO comments
Ensure the code compiles and runs correctly
Commit and push regularly
Submit a pull request from development to main
---
## Evaluation Criteria ⚖️
Functionality: Code compiles and runs without errors; all features work correctly
Code Quality: Clean, readable, well-structured code with proper naming
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 userprovided movie ID.
Advanced search (title, genre, year, rating, etc.)
Sorting options for movies
Save/load favorite movies to/from a file
Improved console menu design
GUI version using JavaFX
---
## Submission ⌛
Deadline: May 1st (11 Ordibehesht)