2.3) BACKGROUND
Engineers and scientists are problem solvers!
According to Arvid Eide et al. in Engineering Fundamentals and Problem Solving, as part of the
problem solving activity, engineers and scientist will have to follow these problem analysis
steps:
1. Recognize and understand the problem,
2. Accumulate facts,
3. Select the appropriate theory or principle,
4. Make necessary assumptions,
5. Solve the problem,
6. Verify and check results.
Page 1 of 8
Prepared By Aiman Bin Ismail May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
3. Design,
4. Implementation,
5. Verification and Testing.
Note: Failure is part of the process, so just chill!
Step 2: Analysis
In this step, we are going to determine what are the inputs, outputs and appropriate theories
related to our problem.
Input(s): Ask yourself, if you are required to solve the problem by your boss for example, what
information do you need? Clearly in this case, we need to request the radius of the circle from
the boss.
Output(s): Based on the problem, we are required to calculate the area and the circumference
of a circle. Hence, these are the only outputs we are going to deliver. Nothing less, nothing
more
Relevent Theories: Based on our knowledge of geometry, to calculate a circles area, the
formula is Area = r2 while the formula to calculate its circumference is given as
Circumference = 2r. From these equations, we need to have the value of the constant (PI),
which is equal to 3.14159
Page 2 of 8
Prepared By Aiman Bin Ismail May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Data requirements
Problem Constant:
PI 3.14159
Problem Input:
Radius /* radius of a circle */
Problem Outputs:
Area /* area of a circle */
Circumference /* circumference of a circle */
Relevant Formulas:
Area of circle = r2
Circumference of circle = 2r
Step 3: Design
Next is to list the steps needed to solve the problem. The initial algorithm as follows:
Get circle radius value
Calculate area
Calculate circumference
Display the area and circumference values
Although this example is quite straight forward, it is helpful to refine some of the steps in the
initial algorithm above. Step 1 (getting data) and Step 4 (display outputs) are basic steps; hence
do not require further refinement. Steps 2 and 3 however can be refined to add some detail to
show explicitly the formula (or detail steps) to be used.
Step 2 refinement:
2.1 Area is PI radius radius (Area= r2).
Step 3 refinement:
3.1 Assign the product of two times PI and radius to circumference.
Page 3 of 8
Prepared By Aiman Bin Ismail May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Step 4: Implementation
Note: Dont worry about this yet
/*
* Calculates and displays the area and circumference of a circle
*/
#include <stdio.h>
#define PI 3.14159
int
main()
{
double radius, /* input radius of circle*/
area, /* output radius of circle*/
circum; /* output radius of circle*/
return(0);
}
Page 4 of 8
Prepared By Aiman Bin Ismail May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Output:
Page 5 of 8
Prepared By Aiman Bin Ismail May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Step 2: Analysis
Data requirements
Problem Constant:
Problem Input:
Problem Outputs:
Relevant Formulas:
Step 3: Design
Page 6 of 8
Prepared By Aiman Bin Ismail May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Page 7 of 8
Prepared By Aiman Bin Ismail May 2015
Collage of Engineering (COE) EEEB114: Programming For Engineers
Page 8 of 8
Prepared By Aiman Bin Ismail May 2015