Assignment 8 GUI Assignment For Problem 3 The Fines
Assignment 8gui Assignment For Assignment 3 Problemthe Fines For Spe
Assignment 8. GUI Assignment for Assignment 3 problem. The fines for Speeding in one of the counties in Florida is given in the following table. MPH Over Speed Limit Fine Less than 10 MPH $129.00 Less than 15 MPH $204.00 Less than 20 MPH $254.00 Less than 30 MPH $279.00 Greater than or equal to 30 MPH Court Mandatory If you speed in school or construction zone your fine can be doubled . Inputs: · Speed Limit of a zone. · Speed of the Vehicle · Whether Construction or School Zone. Y/N (You can show this as a radio button or an input box like the speed entries) The program also should display the following message for each of the above cases as shown in the table below: Less than 10 MPH Be Careful Less than 15 MPH Drive with caution Less than 20 MPH You are driving dangerous Less than 30 MPH You are in Danger zone Greater than or equal to 30 MPH See ya in court For example your output should look like: Speed Limit: 45 Vehicle speed: 66 Construction or School Zone: No Total Fine Calculated = $254.00 Display: “You are Driving Dangerous”. OR like: Speed Limit: 45 Vehicle speed: 57 Construction or School Zone: Yes Total Fine Calculated = $408.00 Display: “Drive with Caution”. ( The values shown bold are input values ) Redo assignment 3 graphically using tkinter where the inputs are entered into a graphic box and output which is calculated fine should be exhibited in a different box and the display message in a different box like we did the temperature converter program. You can reuse the method from assignment 3 if applicable to calculate the fine and the message.
Paper For Above instruction
The purpose of this project is to develop a graphical user interface (GUI) application using Python's Tkinter library that calculates speeding fines based on user inputs. This program aims to improve user interaction by providing an intuitive and visually organized interface that accepts data, performs calculations, and displays results effectively. The core logic involves determining the fine amount based on miles per hour (MPH) over the speed limit, considering whether the zone is a construction or school zone, which doubles the fine, and finally, displaying both the calculated fine and a relevant safety message.
The application begins by prompting the user to input the speed limit of a zone, the vehicle's current speed, and whether the zone is a construction or school zone. These inputs should be collected through appropriate GUI components such as entry boxes, radio buttons, or checkboxes for ease of use. Accurate input collection is vital to ensure proper calculation and user feedback.
The calculation of the fine is based on a predefined table:
- Less than 10 MPH over the limit: $129.00
- Less than 15 MPH over the limit: $204.00
- Less than 20 MPH over the limit: $254.00
- Less than 30 MPH over the limit: $279.00
- Greater than or equal to 30 MPH: Court is mandatory, and the fine is considered in that context.
The program determines the fine by evaluating the MPH over the speed limit and selecting the appropriate fine amount accordingly. If the zone is designated as a construction or school zone, the fine amount is doubled, reflecting the increased penalty for such areas. For violations at or above 30 MPH over the limit, the program displays that court proceedings are mandatory, and the fine is calculated accordingly.
In addition to calculating the fine, the application displays a message based on the severity of the violation:
- Less than 10 MPH: Be Careful
- Less than 15 MPH: Drive with caution
- Less than 20 MPH: You are driving dangerous
- Less than 30 MPH: You are in Danger zone
- Greater than or equal to 30 MPH: See ya in court
The GUI should have separate display areas for the inputs, calculated fine, and message output. The inputs should be collected through input boxes for the speed limit and vehicle speed, radio buttons or checkboxes for the zone type, and buttons to trigger the calculation. The outputs should be displayed in different designated areas or labels for clarity, akin to the temperature converter project. The design aims to make the program user-friendly and visually organized.
Implementation Details
The program must be implemented in Python using the Tkinter library. It should include:
- Input fields for speed limit, vehicle speed, and zone type (construction or school)
- A button to perform the calculation
- Output display areas for the total fine and the safety message
The calculation method can be reused or adapted from assignment 3, ensuring code efficiency and reusability. Focus on creating a clean and functional interface that aligns with the specifications outlined above.
References
- Tkinter documentation: https://docs.python.org/3/library/tkinter.html
- Python GUI programming tutorials: Real Python
- Official Python tutorials on Tkinter: https://docs.python.org/3/library/tkinter.html
- Handling user inputs and events in Tkinter: LikeGeeks
- Python best practices for GUI applications: Real Python
- Data validation in Tkinter: Stack Overflow
- Design patterns for GUI applications: Refactoring Guru
- Advanced Tkinter widgets and features: Code Source IO
- Handling conditional logic in GUIs: Tkinter Tutorials
- Building user-friendly interfaces in Python: Real Python