Download
me 142 engineering computation i n.
Skip this Video
Loading SlideShow in 5 Seconds..
ME 142 Engineering Computation I PowerPoint Presentation
Download Presentation
ME 142 Engineering Computation I

ME 142 Engineering Computation I

160 Views Download Presentation
Download Presentation

ME 142 Engineering Computation I

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. ME 142Engineering Computation I Variables, Equations & Functions Introduction to Basic Programming Language

  2. Variables • A named element that stores information or data • Variable examples: • A=2.45 • X=Y+Z • I=I+1 • B=“Hello Class”

  3. Basic Math Operators • Same as used in Excel spreadsheets + add - subtract * multiply / divide ( ) parenthesis ^ exponent

  4. Enabling the Developer’s Ribbon

  5. Launching VBA • Enable Developer’s Tab • Once enabled, should remain enabled • Select Visual Basic from Developer’s Tab

  6. Launching VBA • Right click on Project… • Select Insert/Module

  7. Launching VBA Congratulations, you’re ready to begin programming!

  8. Example VBA Function Function demo(a,b) ' (Input) 'An example program to add two numbers 'Add 2 numbers (Process) c = a + b 'Return results (Output) demo= c End Function

  9. Executing a VBA Function