Write a GUI program that calculates a car's gas mileage. The programs window should have Entry widgets that let the user enter the number of gallons of gas the car holds, and the number of miles or kilometers it can be driven on a full tank. When a Calculate MPG button is clicked, the program should display the number of miles or kilometers that the car may be driven per gallon of gas. Use the following formula to calculate miles-per-gallon:
MPG = miles / gallons
miles = kilometers x 0.6214
NOTE: The user should be able to choose a radio button for Miles or Kilometers, then the corresponding label should appear. Because some of the functionality to remove/ replace a label and/or frame are beyond the scope of this course, you only required to display according to one selection.
ASSUMPTIONS - The user will:
The GUI must display as follows (please do NOT deviate from the images below):
Images and explanation of what user should see
Initial screen. No radio button should be selected: see image.
If the user chooses Miles, the appropriate label should display. Notice it says "Enter the number of miles": see image.
After the user enters data, the appropriate calculation should display. At this point, the user will click Quit and the window closes: see image.
After the initial screen, if the user chooses Kilometers, the appropriate label should display. Notice it says "Enter the number of kilometers": see image.
After the user enters data, the appropriate calculation should display. At this point, the user will click Quit and the window closes: see image.
Write the code for the program in one file.