1 / 8

ENGR 330: Today’s Class

ENGR 330: Today’s Class. Administrative: do you want another lab? Notes on 11 Fundamentals of procedural programming Walking through 11 Making a subroutine/procedure/method/. Notes on 11. The point is to do numeric format conversion BY HAND, not by relying on other software

virote
Download Presentation

ENGR 330: Today’s Class

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

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

  5. Let’s walk through 11 • Declarations • Initializations • Set up the loop • Do the loop • Print the result R. Smith - University of St Thomas - Minnesota

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

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

  8. That’s it. • 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. R. Smith - University of St Thomas - Minnesota

More Related