Write a program for evaluating the stability of a circular cylinder placed in a fluid with its axis vertical. Call for input data for diameter, length, and weight (or specific weight) of the cylinder; location of the center of gravity; and specific weight of the fluid. Solve the position of the cylinder when it is floating, the location of the center of buoyancy, and the metacenter. Compare the location of the metacenter with the center of gravity to evaluate stability.