SME1013 SME1013 PROGRAMMING PROGRAMMING FOR ENGINEERS FOR ENGINEERS
Ainullotfi bin Abdul Latif Ainullotfi bin Abdul Latif
Faculty of Mechanical Engineering UTM Faculty of Mechanical Engineering UTM
SME1013 SME1013 PROGRAMMING PROGRAMMING FOR ENGINEERS FOR - - PowerPoint PPT Presentation
SME1013 SME1013 PROGRAMMING PROGRAMMING FOR ENGINEERS FOR ENGINEERS Ainullotfi bin Abdul Latif Ainullotfi bin Abdul Latif Faculty of Mechanical Engineering UTM Faculty of Mechanical Engineering UTM Problem Solving Problem Solving
Faculty of Mechanical Engineering UTM Faculty of Mechanical Engineering UTM
Feb 22, 2012 SME1013 Programming for Engineers 2
Recognise and understand the problem (what Recognise and understand the problem (what is it that needed to be solved?) is it that needed to be solved?) List the parameters affecting the problem List the parameters affecting the problem (input) (input) Select the appropriate theory Select the appropriate theory Make the necessary assumptions Make the necessary assumptions Solve the problem – may use a computer Solve the problem – may use a computer Verify the results Verify the results
Feb 22, 2012 SME1013 Programming for Engineers 3
Feb 22, 2012 SME1013 Programming for Engineers 4
Feb 22, 2012 SME1013 Programming for Engineers 5
Feb 22, 2012 SME1013 Programming for Engineers 6
Feb 22, 2012 SME1013 Programming for Engineers 7
Feb 22, 2012 SME1013 Programming for Engineers 8
Feb 22, 2012 SME1013 Programming for Engineers 9
Feb 22, 2012 SME1013 Programming for Engineers 10
11 11 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
K and T
F are temperatures in degrees
T K =( T F−32 1.8 )+273.15
12 12 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
T K =( T F−32 1.8 )+273.15
13 13 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
Start Get TF Show TK Stop
T K =( T F−32 1.8 )+273.15
14 14 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
F
K = (T
F-32)/1.8 + 273.15
K
15 15 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
̄ x = 1 n∑
i=1 n
xi
16 16 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
go back to step 2. go back to step 2.
in the set to get the average in the set to get the average
17 17 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
Start Get number Calculate mean Show sum and mean Stop Count number Any more number? Calculate sum Yes No
18 18 SME1013 Programming for Engineers SME1013 Programming for Engineers Feb 22, 2012 Feb 22, 2012
Start Get xi Mean = sum/n Show sum and mean Stop i ← i + 1 Any more number? Yes No i ← 0 n ← i sum ← 0 j ← 0 j ← j + 1 Is j ≥ n? sum ← sum + xj No Yes