Write a Python application that allows the user to convert between temperatures in fahrenheit and temperatures in celsius. Below are the formulas for both, where Tc is temperature in celsius and Tf is temperature in fahrenheit: Tc = (5/9)*(Tf-32) Tf = ((9/5)*Tc)+32 Before you worry about that, though, design your GUI on paper. It is not obvious what buttons and fields are required. Look on the web to see how others have done this, sketch each screen and how it looks in different states. The font, use of white space and placement of controls is not important; focus on what controls and textfields will be present and what each will be used for. Be sure it is obvious to the user what she should do next and what the numbers on the screen mean. Note that the user has to be able to type in either celsius or fahrenheit temperatures, and to perform repeated conversions in either direction. Try not to limit the user at all. I recommend that you use tkinter, which comes standard with Python 3.x.
However, if you would like to use a different GUI library you can do that. It is important that you respect the separation between the View and the Model. This means that the classes that put the Frame, Buttons, etc up on the screen cannot contain any of the calculations. Also, the class (or module) that performs the calculations cannot do any of the user interaction. There will be a Controller between the Model and the View that takes care of the communication between the two of them. As always, you must submit proof that your program runs. It is a little harder to record the run for a GUI like this. Here’s how: Windows: When the window that contains your output is up, press: to get the screenshot. Windows places the screen shot onto the clipboard.
Now start Word or Notepad and paste the clipboard into your document. Please submit this document, containing a screen shot of the opening screen and a screen shot of the result of a calculation, together with your source code. Mac: When the window that contains your output is up, press: all at the same time. Mac OS makes your mouse into a marquee that you can drag from top left to bottom right of the screenshot. When you let go, Mac OS puts a file on your desktop called “Screen shot xxxx.png”. Please submit a screen shot of the opening screen and a screen shot of the result of a calculation, together with your source code. HINTS: -Make sure that you follow all the program guidelines! -It might help to start with the three files attached to the end of the section in the Module for "Week 10: Graphical User Interface"
Get Free Quote!
372 Experts Online