Explain how to solve the problem without condition statements

There are 12 cookies per box (sold at $1.14) and 24 boxes per carton. Left over boxes are sold for
57ยข. Remaining cookies are given away free. Given the number of cookies produced, determine the
number of boxes, cartons, left over boxes and the total money made.
Simple math:
leftover cookies: total_cookies % 12;
total boxes: total_cookies / 12
leftover boxes: total_boxes % 24
cartons: total_boxes / 24

Topic archived. No new replies allowed.