1. **Tonnage**: A metric ton is 35,273.92 ounces. 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 needed to yield 1 metric ton of cereal. Your program should allow the user to repeat this calculation as often as the user wishes.

1b. Make sure the indenting of the code follows the Style rule in 2.5, also here.

1c.. Review the quality of the variable names.

2. **Square Root**: The Babylonian algorithm to compute the square root of a number ** n** is as follows:

- Make a guess at the answer (you can pick
as your initial guess).*n*/2 - Compute
*r*=*n*/*guess* - Set guess =
**(***guess*+*r*) / 2 - Go back to step 2 for as many iterations as necessary. The more that steps 2 and 3 are repeated, the closer guess will become to the square root of
.*n*

This topic: SCMP118 > Main > Spring2017 > HandsOn2325

Topic revision: r3 - 2017-09-07 - JimSkon

Copyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Ideas, requests, problems regarding TWiki? Send feedback

Ideas, requests, problems regarding TWiki? Send feedback