Assignment 3

Rod Cutting Implementation

By Isaac K. Attuah










============>




This program uses the Rod Cutting Algorithm to provide various prices per rod cut and the Maximum Price after all price computations.


Sample Report on Rod Cutting Problem

  1. For input sizes less than 5 or greater than 25, the program issues a warning and does not run.
  2. -----------------------------------------------------------------------------
    [8,16,26,87] //Array of 4 elements
    Input must be between 5 and 25
    -----------------------------------------------------------------------------
    -----------------------------------------------------------------------------
    [2,11,11,15,16,18,20,24,33,42,47,51,52,52,54,56,58,61,64,67,68,78,84,85,88,93]
    Input must be between 5 and 25
    -----------------------------------------------------------------------------

  3. For input sizes within the range, prices are computed in various stages and the maximum and minimun prices are taken. This is done repeatedly until the final maximum price is produced
  4. -----------------------------------------------------------------------------
    [45,48,65,86,98]
    -----------------------------------------------------------------------------
    Minimum Cost Values: 45,48,65,86,98,130,146,163,184,196,228,244,261,282,294,326,342,359,380,392
    Minimum Cost: 392
    Steps taken: 420
    Maximum Cost Values: 45,90,135,180,225,270,315,360,405,450,495,540,585,630,675,720,765,810,855,900
    Maximum Cost: 900
    Steps taken: 420
    -----------------------------------------------------------------------------
    Detailed Output Link: Output.txt