Write a computer program that for a given state of plane stress and a given yield strength of a ductile material, can be used to determine whether the material will yield. The program should use both the maximum shearing-strength criterion and the maximum-distortion-energy criterion. It should also print the values of the principal stresses and, if the material does not yield, calculate the factor of safety.