Week 1 Part 1 Fundamentals
Week 1 Part 1 Fundamentals
Programming allows you to improve your problem-solving skills and as we know this is a
critical skill to have as an engineer, moreover it is an exciting skill that can broaden your
career possibilities as an engineer as it can be used in various fields.
1. Specification: The description of the task that should be executed by the program
2. Algorithm design: The method that will be used to execute the task must be designed
so that the program adheres to the specification
3. Coding of the algorithm: The algorithm must be written in a programming language
that can be executed by the computer.
4. Execution: The program must be executed with a set of examples that reasonably
cover all the possible cases of data input. If the program does not work properly, the
algorithm will have to be redesigned.
1. Specification:
• Input – the program reads the given radius and height of the cone.
• Output – the program calculates the volume of the cone, using the formula for a
cone.
2. Algorithm design:
• There are two common methods used to design/plan a program: using pseudocode
or a flowchart.
volume = 1/3*3.14*r*r*h
As mentioned previously, we’ll be using the MATLAB language in this course, the code
will look as follows
(Run the code below using the Run Section button, ):
Now you try! Write pseudocode for calculating area of a circle below:
Later we’ll see how we write the MATLAB code for the area of a circle in
Mathematical Functions.
• Week_1_Part_1_Fundamentals.mlx