#This program converst degrees C to degrees F import graphics as gph def main(): window=gph.GraphWin("Temperature Converter", 400,300) window.setCoords(0,0,3,4) #Construct User Interface gph.Text(gph.Point(1,1),"Fahrenheit Temperature:").draw(window) gph.Text(gph.Point(1,3)," Celsius Temperature:").draw(window) #button tempInput=gph.Entry(gph.Point(2,3),7) tempInput.draw(window) tempOutput=gph.Text(gph.Point(2,1),"") tempOutput.draw(window) button=gph.Rectangle(gph.Point(1,1.5),gph.Point(2,2.5)) button.draw(window) buttonText=gph.Text(gph.Point(1.5,2),"CONVERT") buttonText.draw(window) #get user input window.getMouse() celsius= float(tempInput.getText()) fahrenheit=(9/5)*celsius+32 tempOutput.setText(round(fahrenheit,2)) #close the window/end program buttonText.setText("QUIT") window.getMouse() window.close() main()