0

write a program that will read the weight of a package of breakfast cereal in ounces and output the weight in metric tons as well as the number of boxes neede to yield one metric ton of cereal

7
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by William Hemsworth
0

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.

0

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.

0

You need to show at least a bit of effort, not just dump a question and expect us to solve it, you haven't even said what your problem is. What do you expect us to do ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.