代写Assessment 2: Python application programming: GUI.调试Python程序
- 首页 >> Web
Instructions
This assignment will test your knowledge and skills in writing an application software for a given problem, understanding its business rules, and coding a suitable solution using Python. As such, the assignment requires you to integrate and synthesise what you have learnt so far in this unit (content from week 1 to week 9), in order to design and create a proper working solution.
Background:
This programming assignment involves an escalation of the landing gear sensors problem discussed during the lectures and in your first assessment (also repeated here for your reference). You need to use your proposed solutions and calculations from Assignment 1, but this time you need to wrap everything up in a graphical user interface (GUI).
This Assignment has two parts:
· Part 1: Use your proposed solution to the airplane challenge and replace the shell- based menu by a suitable GUI.
· Part 2: The “black box” (that is, the dictionary) you implemented in Assignment 1 and in Part 1 above, needs now to be developed via an external text file.
Submission
· This is a SOLO ASSIGNMENT.
· Allocated marks are shown at the end of each item.
· This assignment requires you to complete Python code written in .py modules, in addition to supporting files.
· Create a folder called “uxxxxx Assignment2” and drop all your files in there. Python modules are compulsory. No modules, no marks.
· Compress (zip) ALL your files and folders created above in one single file called uxxxxx_Assignment2.zip. Upload this file on Canvas by the due date using the drop box provided in the corresponding assignment.
· There are 60 marks in total for this assignment.
Assessment 2: Python application programming: GUI.
Recap from Assignment 1
In Assignment 1, you briefly explained the problem to be solved, including inputs and outputs, and handwritten calculations. You developed the logic for the Boolean circuit and calculated the lift. All the previous steps were used to create a shell-based menu in Python.
The following information/problem on the aircraft functional monitoring system is for revisiting the challenge from Assignment 1 as a reference only. You DO NOT need to redo this part!!!
Your Challenge (Adapted from Floyd, Th. Digital Fundamentals, Pearson, 2015)
As part of an aircraft's functional monitoring system, a logic circuit is needed to display the status of the landing gears before landing. The system should illuminate a green LED if all three landing gears are fully extended when the 'gear down' switch is activated in preparation for landing (the pilots need an extra visual signal lasting 10 seconds as a warning about the activation of the switch). Conversely, a red LED should light up if any of the landing gears fail to extend properly (see Figure 1).
Figure 1: Airplane’s Landing Gear Sensors.
In addition, a rotational sensor located in the directional gear below the cockpit, informs the pilots if the gear is not aligned with the aircraft’s fuselage (set up as 0 degrees when properly aligned). If this is the case, the red led described above should also be activated (see Figure 2).
The circuit relies on sensors: a HIGH voltage indicates that a landing gear is extended, while a LOW voltage indicates it is retracted. All sensors are digital transducers. However, the directional sensor is an analogue transducer, that is, the signal it portrays happens to be continuous.
Aiming to preserve the integrity of the fuselage if the landing approach fails due to a gear system’s malfunction, airplane’s lift needs to be calculated and presented to the pilots in the cabin.
Figure 2: Airplane’s Directional Gear in Wrong Position. Credits: SamChui.com. “Batik Airbus A320 Lands with NLG Rotated 90 Degrees”
The following information/problem on the aircraft functional monitoring system is for Assignment 2. You need to complete the following tasks in Part 1 and 2.
Part 1:
In your Assignment 1, the user input and output were not very satisfactory from the human computer interaction and usability point of view. Hence, your task in this assignment is to design and implement a Graphical User interface (GUI) using buttons and labels that provides an easy to use interface.
Use the same code for the calculations from your Assignment 1. Reusing code is an important part of software development.
You have a great degree of freedom in what GUI elements you choose and how you would like to design the layout of your GUI. What matters is the functionality of the design, and that the user can input the required data in a sensible fashion. However, some elements are compulsory, as we need to assess your understanding of performing a suitable GUI.
Part 1 Marks allocation: [Total Marks: 45]
Your GUI application must allow a user to input various data element, your GUI must:
· Use the Grid element. [3 marks]
· Add Label elements throughout your GUI. [3 marks]
· Use the Background Colour property. [3 marks]
· Allow a user to select choices from an either list box, drop-down menu, or scroll-down menu element. [5 marks]
· Allow a user to input the data using an entry widget. [3 marks]
· Output data using an entry widget. [3 marks]
· Allow a user to click on a Calculate button that triggers any calculation. [3 marks]
· Allow a user to press an Exit or Quit button to properly close the program. [3 marks] Marks are also allocated as follows:
· GUI Design. Is it simple to use and easy to understand? [3 marks]
Assessment 2: Python application programming: GUI.
· Program is written using well-defined functions including a main() function to direct the program. [3 marks]
· Program code layout. Separate blocks of code by a blank line. [3 marks]
· Separate GUI functionality from calculations. You should use a separate method for the calculations. It is good practice and follows good programming style to separate GUI code from other code. [3 marks]
· Use comments. [3 marks]
· The program must have an introduction. [2 marks]
· Business rules are met. That is, your code solves the problem you are proposing (or at least contributes to its solution). [2 marks]
Part 2:
The second part of this assignment is to add to your code and GUI an external .txt file that can be read
(in the example case study from Assignment 1, the astronaut tool weight data), and put these into an appropriate storage in memory (it is suggested that you use either a nested list or a dictionary) and display the details to the user when requested.
Please note that the text file needs to be written by yourself according to your proposed solution. You can use any text editor such as Notepad (do not use Word) .
Part 2 Marks Allocation: [Total Marks: 15]
· The text file is properly written according to the problem proposed [5 marks]
· The text file should only be read once. You probably want to do that at the start of the program. Consider how you would do that. [5 marks]
· Correct display of data based on the details in the text file. [5 marks]