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
Select the level of education that is best demonstrated in each example.
Nastasia [14]

Answer:

masters

associate

bachelors

Explanation:

8 0
3 years ago
Read 2 more answers
How many power station do we have​
loris [4]

Answer: 9,719

Explanation:

5 0
3 years ago
Tensile Strength (MPa) Number-Average Molecular Weight (g/mol)
IceJOKER [234]

Answer:

\mathbf{T_{S \infty } \ \approx 215.481 \ MPa}

\mathbf{M_n = 49163.56431  \ g/mol }

Explanation:

The question can be well structured in a table format as illustrated below:

Tensile Strength (MPa)            Number- Average Molecular Weight  (g/mol)

82                                                  12,700

156                                                 28,500

The tensile strength and number-average molecular weight for two polyethylene materials given above.

Estimate the number-average molecular weight that is required to give a tensile strength required above. Using the data given find TS (infinity) in MPa.

<u>SOLUTION:</u>

We know that :

T_S = T_{S \infty} - \dfrac{A}{M_n}

where;

T_S = Tensile Strength

T_{S \infty} = Tensile Strength (Infinity)

M_n = Number- Average Molecular Weight  (g/mol)

SO;

82= T_{S \infty} - \dfrac{A}{12700} ---- (1)

156= T_{S \infty} - \dfrac{A}{28500} ---- (2)

From equation (1) ; collecting the like terms; we have :

T_{S \infty} =82+ \dfrac{A}{12700}

From equation (2) ; we have:

T_{S \infty} =156+ \dfrac{A}{28500}

So; T_{S \infty} = T_{S \infty}

Then;

T_{S \infty} =82+ \dfrac{A}{12700} =156+ \dfrac{A}{28500}

Solving by L.C.M

\dfrac{82(12700) + A}{12700} =\dfrac{156(28500) + A}{28500}

\dfrac{1041400 + A}{12700} =\dfrac{4446000 + A}{28500}

By cross multiplying ; we have:

({4446000 + A})*  {12700} ={28500} *({1041400 + A})

(5.64642*10^{10} + 12700A) =(2.96799*10^{10}+ 28500A)

Collecting like terms ; we have

(5.64642*10^{10} - 2.96799*10^{10} ) =( 28500A- 12700A)

2.67843*10^{10}  = 15800 \ A

Dividing both sides by 15800:

\dfrac{ 2.67843*10^{10} }{15800} =\dfrac{15800 \ A}{15800}

A = 1695208.861

From equation (1);

82= T_{S \infty} - \dfrac{A}{12700} ---- (1)

Replacing A = 1695208.861 in the above equation; we have:

82= T_{S \infty} - \dfrac{1695208.861}{12700}

T_{S \infty}= 82 + \dfrac{1695208.861}{12700}

T_{S \infty}= \dfrac{82(12700) +1695208.861 }{12700}

T_{S \infty}= \dfrac{1041400 +1695208.861 }{12700}

T_{S \infty}= \dfrac{2736608.861 }{12700}

\mathbf{T_{S \infty } \ \approx 215.481 \ MPa}

From equation(2);

156= T_{S \infty} - \dfrac{A}{28500} ---- (2)

Replacing A = 1695208.861 in the above equation; we have:

156= T_{S \infty} - \dfrac{1695208.861}{28500}

T_{S \infty}= 156 + \dfrac{1695208.861}{28500}

T_{S \infty}= \dfrac{156(28500) +1695208.861 }{28500}

T_{S \infty}= \dfrac{4446000 +1695208.861 }{28500}

T_{S \infty}= \dfrac{6141208.861}{28500}

\mathbf{T_{S \infty } \ \approx 215.481 \ MPa}

We are to also estimate the number- average molecular weight that is required to give a tensile strength required above.

If the Tensile Strength (MPa) is 82 MPa

Definitely the average molecular weight will be = 12,700 g/mol

If the Tensile Strength (MPa) is 156 MPa

Definitely the average molecular weight will be = 28,500 g/mol

But;

Let us assume that the Tensile Strength (MPa) = 181 MPa for example.

Using the same formula:

T_S = T_{S \infty} - \dfrac{A}{M_n}

Then:

181 = 215.481- \dfrac{1695208.861 }{M_n}

Collecting like terms ; we have:

\dfrac{1695208.861 }{M_n} = 215.481-  181

\dfrac{1695208.861 }{M_n} =34.481

1695208.861= 34.481 M_n

Dividing both sides by 34.481; we have:

M_n = \dfrac{1695208.861}{34.481}

\mathbf{M_n = 49163.56431  \ g/mol }

5 0
3 years ago
The bulk modulus of a fluid if it undergoes a 1% change in volume when subjected to a pressure change of 10,000 psi is (a) 0.01
Veseljchak [2.6K]

Answer:

The required bulk modulus is 10^{6} Psi. So, the answer is non of these.

Explanation:

Change in pressure of the fluid is directly proportional to the volumetric strain. The constant of proportionality is the bulk modulus of the fluid.

Step1

Given:

Percentage change in volume is 1%.

Change in pressure is 10000 Psi.

Calculation:

Step2

Volumetric strain is calculated as follows:

\frac{\bigtriangleup V}{V}=\frac{1}{100}

\frac{\bigtriangleup V}{V}=0.01

Step3

Bulk modulus is calculated as follows:

\frac{\bigtriangleup V}{V}=0.01

\frac{\bigtriangleup V}{V}=0.01

10000=K\times0.01

K = 1000000 Psi.

Thus, the required bulk modulus is 10^{6} Psi.

3 0
3 years ago
Relation between Poisson's ration, young's modulus, shear modulus for an isotropic material
poizon [28]

Answer:

 E=2 G(1+2μ)

Explanation:

Isotropic material :

 Those material have same property in all direction is known as isotropic material.

Homogeneous material :

 Those material have same property through out the volume is known as homogeneous material.

Relationship between Poisson ratio ,young modulus and shear modulus:

   E=2 G(1+2μ)

Relationship between Poisson ratio ,bulk modulus and shear modulus:

E=2 K(1-μ)

Where

E is  young modulus.

G is shear modulus.

μ is Poisson ratio.

 

8 0
3 years ago
Other questions:
  • Water enters a leaky cylindrical tank (D = 1 ft) at a rate of 8 ft3/min. Water leaks out of the tank at a rate of 17% of the flo
    14·1 answer
  • A 1000 KVA three phase transformer has a secondary voltage of 208/120. What is the secondary full load amperage?
    9·1 answer
  • Please help I need it by today!!!
    10·1 answer
  • The air standard efficiency ofan Otto cycle compared to diesel cycle for thie given compression ratio is: (a) same (b) less (c)
    12·1 answer
  • 5. The pin support at A allows _______. Select the one that applies. (a) displacement in the x direction (b) rotation about its
    15·1 answer
  • Does anyone know obamas last name???? please help its for a friend I swear!!!111!!11!
    8·1 answer
  • Which of the following is an example of a pulley?
    10·2 answers
  • One reason the shuttle turns on its back after liftoff is to give the pilot a view of the horizon. Why might this be useful?
    6·2 answers
  • Explain how you would solve for total resistance in a parallel circuit versus a series circuit. How would you apply and solve fo
    10·1 answer
  • Whats the purpose of the keyway
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!