Reference no: EM132856433
Instruction
This assignment will test your knowledge and skills in writing an application software for a task, understanding the business rules of a particular problem, coding these in a computer program, developing a graphical user interface, and reading data from a text file from a disk. As such, the assignment requires you to integrate and synthesise what you have learnt so far in this unit, in order to design and create a proper working solution.
The context of this programming assignment is free for you to choose. Think about any problem you may be facing that is suitable to be tackled from an IT-programming perspective. I have chosen a case study to show you how would you approach the problem from the very beginning, the compulsory elements need to be included in your solution, and the final (and hopefully nice and useful) product.
This assessment has three stages:
- Stage 1: A simple Python program using an interactive text-based menu (no GUI)
- Stage 2: The same as stage 1, but wrapped in a graphical user interface (GUI)
- Stage 3: The input comes from a text file - read only once, then information stored in a suitable data structure.
The following case study shows the integration of these stages. Please bear in mind that this is an example only. Your solution does not need to be exactly the same as this one. However, be sure that you include every single element described at the end of each proposed stage. Allocated marks are shown in [bold red], whereas instructions/comments are shown in [bold blue].
Stage 1. Developing a Command-Line menu.
Step-by-Step Guide for Stage 1 (using the case study as an example)
1. Think about your strategy on how you will display the options for user to choose from according to your flowchart. How you will calculate the available personal item mass for each astronaut and how to calculate the average available mass and average available weight. Think about writing simple functions for the repetitive calculations.
2. Create a new Python file, you may call it ProgAsgStage1
3. In the Stage1 class (file ProgAsgStage1.py), you may put all code for the user interaction and the calculation into the main method. (You might still need to define global variables and constants outside the main method at the top of the editor window). You might like to use nested lists to hold the name and mass multiplier of the celestial bodies.
4. You will need to write a function to print a menu to the user. One possible example is:
5. Now add the code that implements your strategy to display the different destinations with their mass multipliers, TEST.
6. Add the code to display the weight allowances for the two different types of astronaut, TEST.
7. Add the code to calculate the personal mass allowances of each of the six astronauts along with the total available mass, TEST.
8. Add the code to calculate the average available mass allowance and weight on destination, TEST.
9. Finally, add print statements to print the output to the user.
10. Test your implementation with the test cases mentioned below (and additionally your own).
How the marks for Stage 1 are allocated:
Marks are allocated as follows:
• Constants vs literals. Using constants is important for the ease of maintenance. Not using constants will result in lower marks. For example, in this case study we consider constants for the mass multipliers for each celestial body and the upper limit for each type of astronaut.
• Good names for your variables and constants. Check style against the Python style guide attached below.
• The program must have at least one mathematical calculation.
• You must use functions for each task in your code, for example a printMenu function to print a menu and calculateAverageMass to calculate the average available mass.
• Your program must have a main() function to appropriately direct the program.
• Program code layout. Separate blocks of code by a blank line.
• Program is written using well-defined functions including a main() function to direct the program.
• Use of comments. A comment is not an essay. Comments are important for the maintenance of a program and should contain enough details but keep them concise. Do not comment every single line.
• The program must have a short introduction. Check style against the Python style guide attached below.
• The program must work correctly. That is:
o A text-based menu is displayed when first running your program.
o The menu works properly.
o Calculations are correctly performed.
o The output on the shell is properly formatted.
• Business rules are met. That is, your code solves the problem you are proposing (or at least contributes to its solution).
Stage 2. Developing a Graphical User Interface (GUI)
How the marks for Stage 2 are allocated:
Your GUI application must allow a user to input various data elements. To this end, your GUI must:
• Use the Grid element
• Add Label elements throughout your GUI.
• Use the Background Colour property.
• Allow a user to select choices from an either list box, drop-down menu, or scroll-down menu element.
• Allow a user to input the data using an entry widget.
• Output data using an entry widget.
• Allow a user to click on a Calculate button that triggers any calculation.
• Allow a user to press an Exit or Quit button to properly close the program.
Marks are also allocated as follows:
• GUI Design. Is it simple to use and easy to understand?
• Program is written using well-defined functions including a main() function to direct the program.
• Program code layout. Separate blocks of code by a blank line.
• 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.
• Use comments
• The program must have an introduction. Check style against the Python style guide attached below.
• Business rules are met. That is, your code solves the problem you are proposing (or at least contributes to its solution).
Stage 3. Reading from an external file
How the marks for Stage 3 are allocated:
Marks are allocated as follows:
- The text file is properly written according to the problem proposed
- 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.
- Correct display of data based on the details in the text file.
Attachment:- Application software.rar