Activity 4 - Structure of the code

Workshop Resources

Recalling that the main structure of any code is to follow a series of steps to get a solution. Our steps include plugging in certain number values, selecting a choice from a given number of options, etc. Whatever decision you make for each step will have significant results at the end of the code. Every step will be incorporated into a calculation, which will then spit out the diameter size based on your choices. Additionally, our solution is to get a diameter for our driveshaft and then check afterwards if our diameter size is a good design choice.

There’s already a provided code for you, and your main task is treat this code as a tool so that you can determine your driveshaft diameter based upon all the choices you make. The choices are split down into 5 main steps.

  1. Input Factor of Safety
  2. Select a material for your driveshaft
  3. Select the conditions for your shaft
  4. Plug in the amount of loading that your shaft will experience
  5. Select geometry of your shaft

Don’t worry all of these steps will be explained within the next section.

[insert image]