# Exercise 2: how thick must a floating shelf be for a given height above the sea? RHO_ICE, RHO_SEA = 917, 1028 fraction = 1 - RHO_ICE / RHO_SEA # share of the thickness above the sea print(" height above sea shelf thickness depth below sea") for above in (10, 20, 50): thickness = above / fraction print(f"{above:12d} m {thickness:12.0f} m {thickness - above:11.0f} m") h = 25 / fraction print(f"A cliff 25 m above the sea means about {h:.0f} m of ice in total") # height above sea shelf thickness depth below sea # 10 m 93 m 83 m # 20 m 185 m 165 m # 50 m 463 m 413 m # A cliff 25 m above the sea means about 232 m of ice in total