calculates the cumulative cost for a device