Solve the following problem:
Q: A cylinder fitted with a piston contains 0.5 kg of R-134a at 60°C, with a quality of 50 percent. The R-134a now expands in an internally reversible polytropic process to ambient temperature, 20°C at which point the quality is 100 percent. Any heat transfer is with a constant-temperature source, which is at 60°C. Find the polytropic exponent n and shows that this process satisfies the second law of thermodynamics.