This project consists of two folders, each serving a distinct purpose.
The Boxing folder contains the core project, implemented with Gradle. It's designed to solve the knapsack 0-1 problem using a dynamic programming solution. The project follows Test-Driven Development (TDD) principles.
To run the project:
- Open the Boxing project.
- Run the
Main
class. - When prompted, enter the maximum weight of each box as a float value.
- Enter the specifications for each box in the following format: (1,53.38,$45)(2,88.62,$98)(3,78.48,$3)(4,72.30,$76)(5,30.18,$9)(6,46.34,$48)
- Press Enter, and the program will solve the problem, returning the IDs of the selected boxes.
For example, with a maximum weight of 81 and the specified format for each pack, the result would be: Selected item[s] id: [4]
The Web Service Project is developed using Spring Boot, Hibernate, and JPA. Gradle serves as the build tool. The project includes three APIs for:
- Creating items with the aforementioned format string.
- Retrieving all products in the database.
- Calculating the average price in a given range.
To run the Web Service project:
- Open the Web Service project.
- Run the
Application.java
file. - The Spring Boot application will start the webserver.
The API documentation and contracts are available in a Postman collection located in the resources
folder.
Feel free to contribute to this project! If you have any suggestions or find issues, please open an issue.