[thelist] mod (%) help

Luther, Ron Ron.Luther at hp.com
Thu Jul 17 08:16:07 CDT 2008


Brian Cummiskey asked a fun math question!

>>a kit consists of a lift and 4 wheels.
>>When a complete kit is there, all is well and a discount is applied.


Hi Brian,


Ooooo!  Math for breakfast!  Yummy!  Okay, how about this:

Number of Discounts = min(number of lifts, number of groups of 4 wheels)

Number of groups of 4 wheels = ((number of wheels ordered) - (number of wheels ordered mod 4)) / 4


Price Paid = Total Lift Price + Total Wheel Price

Total Lift Price = (Number of discounts) * (Discounted lift price) + ((Number of lifts ordered) - (Number of discounts)) * (Full lift price)

Total Wheel Price = (Number of discounts) * (Discounted wheel price) * 4 {Cuz there is 4 wheels in a 'discount group'} + (number of wheels ordered mod 4) * (Full wheel price)


I think that should work for ya!


Good Luck!
RonL.



More information about the thelist mailing list