Question

In: Computer Science

Use Matlab GUIDE to create a program with graphic user interfac(GUI). The program is designed to...

Use Matlab GUIDE to create a program with graphic user interfac(GUI). The program is designed to convert the temperature from Celsius to Fahrenheit and the opposite.

(Hint: use radio button)

Solutions

Expert Solution

# Hi i have solve this question using radio button if you have any query feel free to ask

# I have attach image file go through it

# Temperature Converter Program

from Tkinter import*

def submit():
entTemp = 0
entTemp = fahEntry.get()
Fahrenheit = 0
if var.get() == 1:
Fahrenheit = (int(entTemp) * 9/5) + 32
lalresult.set(Fahrenheit);

else:
fahToCel = (int(entTemp) - 32) * 5/9
lalresult.set(fahToCel);

# Program Starts from Here
root = Tk()
root.title("Temperature Converter")
mainframe = Frame(root)
mainframe.grid()
var = IntVar()
celTempVar = IntVar()
celTempVar.set(int(0))
fahTempVar = IntVar()
fahTempVar.set(int(0))
var.set(1)
lalresult = IntVar()

celLabel = Label (mainframe, text = "Enter Temperature : ", font = ("Arial", 16), fg = "black")
celLabel.grid(row = 2, column = 0, pady = 15, sticky = NW)


celLabelresultLbl = Label (mainframe, text = "Result : ", font = ("Arial",9) ,fg = "blue")
celLabelresultLbl.grid(row = 2, column = 1, pady = 50, padx = 35 , sticky = NW)

celLabel1 = Label (mainframe, text = "Result : ", font = ("Arial",9), textvariable = lalresult ,fg = "blue")
celLabel1.grid(row = 2, column = 1, pady = 50, padx = 105 , sticky = NW)


fahEntry = Entry (mainframe, width = 50, bd = 5, textvariable = fahTempVar)
fahEntry.grid(row = 2, column = 1, pady = 10, sticky = NW, padx = 30 )
radioButton = Radiobutton(root, text="Fahrenheit", variable = var , value=1 )
radioButton1 = Radiobutton(root, text="Celcius" , variable = var , value=2)
radioButton.grid(row = 1, pady = 5, sticky = NW, padx = 145 )
radioButton1.grid(row = 1, pady = 5, sticky = NW, padx = 250 )

submitButton = Button (mainframe, text = "Submit", font = ("Arial", 8, "bold"), relief = RAISED, bd=5, justify = CENTER, highlightbackground = "red", overrelief = GROOVE, activebackground = "green", activeforeground="blue", command = submit )
submitButton.grid(row = 5, column = 1,ipady = 8, ipadx = 12, pady = 5, sticky = NW)

root.mainloop()

# Output


Related Solutions

The purpose of this problem is to use graphic user interface (GUI) to interactively store grades...
The purpose of this problem is to use graphic user interface (GUI) to interactively store grades in a text file, rather than adding them manually to a script. Follow these steps to complete the program: Step 1. Use a question dialog box and ask the user “Do you want to run this Program?” with two options for “yes” and “no”. If the user’s answer is “yes”, go to the next step, otherwise, go to Step 6. Step 2. Create a...
Create in java an interactive GUI application program that will prompt the user to use one...
Create in java an interactive GUI application program that will prompt the user to use one of three calculators, label project name MEDCALC. You can use any color you want for your background other than grey. Be sure to label main java box with “MEDCALC” and include text of “For use only by students” On all three calculators create an alert and signature area for each user. The alert should be something like “All calculations must be confirmed by user...
Use the below info to create a java program A GUI interface to ensure a user...
Use the below info to create a java program A GUI interface to ensure a user is old enough to play a game. Properly formatted prompts to input name, address, phone number, and age. Remember that name, address, phone number, etc. can be broken out in additional fields. Refer to the tutorial from this week’s Reading Assignment Multiple vs. Single Field Capture for Phone Number Form Input for help with this. Instructions to ensure that the information is displayed back...
modify the code below to create a GUI program that accepts a String from the user...
modify the code below to create a GUI program that accepts a String from the user in a TextField and reports whether or not there are repeated characters in it. Thus your program is a client of the class which you created in question 1 above. N.B. most of the modification needs to occur in the constructor and the actionPerformed() methods. So you should spend time working out exactly what these two methods are doing, so that you can make...
USE MATLAB Write a program in Matlab that would continuously ask the user for an input...
USE MATLAB Write a program in Matlab that would continuously ask the user for an input between 1 and 6, which would represent the result of rolling a die. The program would then generate a random integer between 1 and 6 and compare its value to the value entered by user. If the user’s die is larger, it should display, “Mahahanap mo na ang forever mo. Sana all!” If the user’s die is smaller, it should display, “Gising na friend,...
Create a simple Graphical User Interface (GUI): Create new JFrameForm and use the Palette to drag...
Create a simple Graphical User Interface (GUI): Create new JFrameForm and use the Palette to drag and drop the Swing Containers and Controllers like the figure shown.  Your Form should accept a file name in its text field. When the user presses OK Button, the content of the String array appear in the Text area below.  Handle all Exceptions (File Not Found Exception) GUI frame
Create a matlab program that calculates equivalent cpacitance and charge by asking the user whether the...
Create a matlab program that calculates equivalent cpacitance and charge by asking the user whether the circuit is in paraller , series or combination and then asks for the values of capacitances and voltage. After that it calculates the equivalent capacitance.
Using matlab: Build a graphical user interface (GUI) the will read the two corners of a...
Using matlab: Build a graphical user interface (GUI) the will read the two corners of a rectangle (from the GUI interface) and show the following: A plot of the rectangle (you should have display for it) Show the centroid (the center of the rectangle) on the graph. Calculate the area and the circumference of the triangle (you need to write a function for that). The interface should have at least the following: Four textboxes to read the ( 2 for...
Create a GUI matlab code that computes for the position, velocity, and acceleration of the equation...
Create a GUI matlab code that computes for the position, velocity, and acceleration of the equation and displays their respective graph.
Create a java Swing GUI application that presents the user with a “fortune”. Create a java...
Create a java Swing GUI application that presents the user with a “fortune”. Create a java Swing GUI application in a new Netbeans project called FortuneTeller. Your project will have a FortuneTellerFrame.java class (which inherits from JFrame) and a java main class: FortuneTellerViewer.java. Your application should have and use the following components: Top panel: A JLabel with text “Fortune Teller” (or something similar!) and an ImageIcon. Find an appropriate non-commercial Fortune Teller image for your ImageIcon. (The JLabel has a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT