Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 2005 1R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Administrative: do you want another lab?Administrative: do you want.

Similar presentations


Presentation on theme: "March 2005 1R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Administrative: do you want another lab?Administrative: do you want."— Presentation transcript:

1 March 2005 1R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Administrative: do you want another lab?Administrative: do you want another lab? Notes on 11Notes on 11 Fundamentals of procedural programmingFundamentals of procedural programming Walking through 11Walking through 11 Making a subroutine/procedure/method/...Making a subroutine/procedure/method/...

2 March 2005 2R. Smith - University of St Thomas - Minnesota Notes on 11 The point is to do numeric format conversionThe point is to do numeric format conversion –BY HAND, not by relying on other software Wanted to get numbers we could calculate withWanted to get numbers we could calculate with –Not what you get by converting from text decimal to text binary Good programs are READABLEGood programs are READABLE –I didn’t push this much because I didn’t give you formatting standards

3 March 2005 3R. Smith - University of St Thomas - Minnesota Procedural Programming What are the 6 things we do in a program?What are the 6 things we do in a program?

4 March 2005 4R. Smith - University of St Thomas - Minnesota Procedural Programming What are the 6 things we do in a program?What are the 6 things we do in a program? –Declare variables –Assignment statements –Call subroutines/procedures/functions/methods –Arithmetic formulas –If statements –Loops

5 March 2005 5R. Smith - University of St Thomas - Minnesota Let’s walk through 11 DeclarationsDeclarations InitializationsInitializations Set up the loopSet up the loop Do the loopDo the loop Print the resultPrint the result

6 March 2005 6R. Smith - University of St Thomas - Minnesota Next Assignment Accumulate several typed-in numbersAccumulate several typed-in numbers Print the accumulated resultPrint the accumulated result Need a function to read in the numberNeed a function to read in the number –Make it variable base/radix Do we want to support hex?Do we want to support hex? –Well, not at first

7 March 2005 7R. Smith - University of St Thomas - Minnesota Building the function for 12 Input and output declarationsInput and output declarations Making the variable radix workMaking the variable radix work Awkward loopsAwkward loops

8 March 2005 8R. Smith - University of St Thomas - Minnesota That’s it. Questions?Questions? Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.


Download ppt "March 2005 1R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Administrative: do you want another lab?Administrative: do you want."

Similar presentations


Ads by Google