read the weight from where? Does your computer have a scale attached to it? Or do you get that info from typeing it in on the keybaord (most likely) ?
Do google to find the math algorithm for converting ounces to metric units. "metric tons" is a awful lot for a box of cereal :) Or you are buying enough cereal to feed an army. If one box of cereal weighs 16 ounces (one pound) then it would take 2,000 boxes to get one short ton. For other conversions see here.
Start by accepting the weight in ounces and converting it to grams. Then divide the weight in grams by the number of grams/ton to get the weight in metric tons. Then divide a metric ton by your weight in grams and you have the number of boxes needed.