2 min read
Shipping Cost Calculator UNI HOMEWORK

JRE 17.0.11

File Structure

  • src/
    • main/
      • Main application entry points
    • items/
      • Product class definitions
    • containers/
      • Container type implementations
    • methods/
      • Calculation and business logic
  • LICENSE
    • Project license
  • README.md
    • Project documentation

Getting Started

Prerequisites

  • Java Development Kit (JDK) 17 or higher
  • Any Java IDE (Eclipse, IntelliJ IDEA, etc.)

Running the Application

  1. Clone the repository:

    git clone https://codeberg.org/omerdduran/ShippingCompHW.git
    cd ShippingCompHW
    
  2. Compile the Java files:

    javac main/*.java items/*.java containers/*.java methods/*.java
    
  3. Run the main application:

    java main.Main
    

Running the Tests

The project includes a test suite with predefined scenarios:

java main.Test

Available test scenarios:

  1. Fill a large container completely
  2. Fill a small container (weight ≤ 500 kg)
  3. Fill a small container (weight > 500 kg)
  4. Mixed items scenario

Features in Detail

Container Types

  • Small Container
    • Custom volume capacity
    • Weight-based pricing (≤500kg: 1000€, >500kg: 1200€)
  • Big Container
    • Larger volume capacity
    • Fixed price: 1800€

Supported Products

  • Laptop
  • Mouse
  • Desktop
  • LCD Screen

Each product has predefined:

  • Dimensions (length, width, height)
  • Weight
  • Volume calculation

Calculations

  • Total volume calculation
  • Total weight calculation
  • Optimal container selection
  • Cost optimization for different container combinations