1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
miskamm [114]
3 years ago
7

Write a GUI-based program that allows the user to convert temperature values between degrees Fahrenheit and degrees Celsius. The

interface should have labeled entry fields for these two values. These components should be arranged in a grid where the labels occupy the first row and the corresponding fields occupy the second row. At start-up, the Fahrenheit field should contain 32.0, and the Celsius field should contain 0.0. The third row in the window contains two command buttons, labeled >>>> and <<<<. When the user presses the first button, the program should use the data in the Celsius field to compute the Fahrenheit value, which should then be output to the Fahrenheit field. The second button should perform the inverse function.
Engineering
1 answer:
Agata [3.3K]3 years ago
4 0

Answer:

def CelsiusToFahenheit(Celsius, entry):

  #Celsius = int(input("Enter a temperature in Celsius: "))

  Fahrenheit = 9.0/5.0 * float(Celsius) + 32

  entry. delete(0, 'end')

  entry.insert(0, str(Fahrenheit))

def FahenheitToCelsius(Fahrenheit, entry):

  #!Fahrenheit = int(input("Enter a temperature in Fahrenheit: "))

  Celsius = (float(Fahrenheit) - 32) * 5.0/9.0

  entry. delete(0, 'end')

  entry.insert(0, str(Celsius))

def main():

   window = Tkinter.Tk()

   window.title("Grid")

   lb = Tkinter.Label(window, text='Fahrenheit')

   lb.grid (row=0,column=0)

   lb1=Tkinter.Label(window,text='Celsius:')

   lb1.grid (row=0,column=1)

   en =Tkinter. Entry(window, justify='right')

   en.grid(row=1,column=0)

   en.insert(0, "32.0")

   en1=Tkinter.Entry(window, justify='right')

   en1.grid(row=1,column=1)

   en1.insert(0, "0.0")

   btnFtoc =Tkinter.Button(window, text='>>>>', command=lambda: FahenheitToCelsius(en.get(), en1))

   btnFtoc.grid(row=2,column=0)

   btnCtoF =Tkinter.Button(window, text='<<<<', command=lambda:  CelsiusToFahenheit(en1.get(), en))

   btnCtoF.grid(row=2,column=1)

   window.mainloop()

if __name__ == '__main__':

   main()

You might be interested in
The water behind Hoover Dam in Nevada is 221 m higher than the Colorado River below it. At what rate must water pass through the
dexar [7]

Answer:

23.06262m^3/s

Explanation:

The volume flow rate of the water is determined from the needed power output and the elevation difference:

Where, height (h) =221m, power(w)=50MW=50*10^6w

Density of water (ρ)=1000kg/m^3

Efficiency of turbine(η)=100%=1

V=W/ρηgh

=50*10^6m^3/(1)*(1000)*(9.81)*(221)s=23.06262m^3/s

3 0
3 years ago
A thin aluminum sheet is placed between two very large parallel plates that are maintained at uniform temperatures T1 = 900 K, T
Maru [420]

The net radiation heat transfer between the two plates per unit surface area of the plates with shield and without shied are respectively; 2282.76 W/m² and 9766.75 W/m²

<h3>How to find the net radiation heat transfer?</h3>

We are given;

Temperature 1; T₁

Temperature 2; T₂

Temperature 3; T₃

Emissivity 1; ε₁ = 0.3

Emissivity 2; ε₂ = 0.7

Emissivity 3; ε₃ = 0.2

The net rate of radiation heat transfer with a thin aluminum shield per unit area of the plates with shield is;

Q'₁₂ = σ(T₁⁴ - T₂⁴)]/[((1/ε₁) + (1/ε₂) - 1) + ((1/ε₃,₁) + (1/ε₃,₂) - 1)]

Q'₁₂ = 5.67 * 10⁻⁸(900⁴ - 300⁴)/[((1/0.3) + (1/0.7) - 1) + ((1/0.15) + (1/0.15) - 1)]

Q'₁₂,shield = 2282.76 W/m²

The net rate of radiation heat transfer with a thin aluminum shield per unit area of the plates with no shield is;

Q'₁₂,no shield = σ(T₁⁴ - T₂⁴)]/((1/ε₁) + (1/ε₂) - 1))

Q'₁₂,no shield = 5.67 * 10⁻⁸(900⁴ - 300⁴)/[(1/0.3) + (1/0.7) - 1)]

Q'₁₂,no shield = 9766.75 W/m²

Then the ratio of radiation heat transfer for the two cases becomes;

Q'₁₂,shield/Q'₁₂,no shield = 2282.76/9766.75 = 0.2337 or 4/17

Read more about Net Radiation Heat Transfer at; brainly.com/question/14148915

#SPJ1

8 0
2 years ago
At a festival, spherical balloons with a radius of 140.cm are to be inflated with hot air and released. The air at the festival
Tpy6a [65]

Answer:

find attached

Explanation:

5 0
4 years ago
Which option identifies the type of power system Tommy will design in the following scenario?
Sedaia [141]

Answer:

diagram of an electrical curcuit

an sketch of an HVAC system

Also 3D image of a hydrualic piston

se

7 0
3 years ago
Which of the following is a way to heat or cool a building without using electricity or another power source?
zzz [600]
I believe the answer is: A. Passive heating and cooling.
8 0
3 years ago
Read 2 more answers
Other questions:
  • What are primary and secondary super-heaters?
    9·1 answer
  • The uniform beam is supported by two rods AB and CD that have crosssectional areas of 10 mm2 and 15 mm2 , respectively. Determin
    5·1 answer
  • Carbon dioxide contained in a piston–cylinder device is compressed from 0.3 to 0.1 m3. During the process, the pressure and volu
    9·1 answer
  • A Type I muscle fibers have an average diameter of 98 µm, and can exert a compressive load of 532 µN[1]. If they are modeled as
    11·1 answer
  • The steady-state data listed below are claimed for a power cycle operating between hot and cold reservoirs at 1200 K and 400 K,
    6·2 answers
  • HEY Y'ALL!!! WILL GIVE BRAINLEST AND THANKS+A LOT OF POINTS!!!!! So in class our teacher wants to help us think out of the box m
    8·2 answers
  • To use wiring diagrams, an understanding of the symbols, abbreviations, and connector coding used in the diagrams
    12·1 answer
  • What is Geography? pliz help​
    8·2 answers
  • I NEED ANSWER'S ASAP PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    9·2 answers
  • 1.The HCF of 15 and 20?<br>2.5!=??...????​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!