Aims
Develop a Python program to solve a problem
Follow good program development and coding style practices Develop a Graphical User Interface
Instructions
Write a Python program to solve the following problem. Your solution should include a
readme.md
file (which includes details of how to run your assignment) and your Python program in a file named armour.py , and be submitted as a single .tgz file named a4.tgz . You should ensure your solution works using the Python 3 interpreter on turing.
Problem
The company board is now quite impressed with your progress and has agreed to allow you unrestricted access to some of the more interesting departments and projects within the company. There are certain projects that you have heard about which you feel may assist in some of your more adventurous hobbies. The crime in your local city is getting out of control and you are particularly attuned to the suffering of many of its citizens. You have decided that you want to do something about it, but you may require some technological advantage. You feel this may be necessary as best to utilise some of the skills that you have acquired abroad.
One department in particular as garnered your interest. You have found a department that specialises in body armour and ballistics. This department develops four kinds of body armour that adhere to the four different certifications (performance standards). Each one is capable of absorbing the impact of different projectiles at different velocities and mass. You want to be able to choose armour based on the force of impact it is capable of absorbing and have decided to start a project of your own.
Your project will be to design a GUI based application that will take a weight in grams and a velocity in meters per second and calculate the force that is required of the armour to absorb. Your application should display the armour type within the interface. To calculate the acceleration of a projectile based on its velocity we can use the simplified equation below.
Acceleration = ( 1/2 x Velocity2 ) / distance (metres)
9/19/2018 Assignment
https://moodle.une.edu.au/mod/assign/view.php?id=1355090 2/4
|
|
Where the starting velocity is set to zero (and ignored) and distance is set to 40 cm (0.4 metres) for the purpose of this exercise. For example if the velocity was 100 metres per second, the result would be (1/2 x
2
10000) / 0.4 = 12,500 m/s . The value for distance (0.4) can be hard coded in this case. The distance was
chosen to represent the acceleration of a projectile as it leaves a barrel of 40cms in length. This equation ignores a number of factors including deceleration and for this reason is not an accurate determination of acceleration, but it allows us to calculate it quickly based on the limited information we have and will allow us to return an adequate grade of armour.
The grade of armour will be chosen based on the force of impact it can absorb and for this we will need to calculate force (in newtons). Thankfully we can already calculate the acceleration and we already have the weight in grams of the projectile. With these we can calculate force.
Force = Mass (kilograms) x Acceleration (metres per second sqaured)
Following the example above, if the mass was 10 grams the result would be 0.01 x 12,500 = 125 newtons. Your application should take two text inputs (one for mass and one for velocity) and calculate the acceleration and the force of the projectile when the user presses find. Once it has this value you can check against a dictionary that contains the force and type certification. If you can check the values in order, you can return the first type that has a force metric higher than or equal to that of the calculated force from the inputs. Once complete you can set the grade label to display the type.
The metrics for each type have been calculated below to assist you in the development of the GUI.
Note that program specifications are not always clear. If you are uncertain about any aspect, you are typically better off asking than making assumptions. Please use the appropriate discussion forum to ask for clarification, if required.
Body Armour Certification
These values have been pre-calculated to assist in the development of your GUI interface:
A potential interface may look like the following: