1 / 12

Computer Science 1MD3 Introduction to Programming

Winter 2014. Computer Science 1MD3 Introduction to Programming. Michael Liut ( liutm@mcmaster.ca ). Table of Contents. Python H igh or Low Level Language? Function vs. Method Nested For Loop Assignment 1_3 & 1_4 Practice MidTerm Questions. High vs. Low Level Languages.

dai-chan
Télécharger la présentation

Computer Science 1MD3 Introduction to Programming

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. Winter 2014 Computer Science 1MD3Introduction to Programming Michael Liut (liutm@mcmaster.ca) www.michaelliut.ca/cs1md3

  2. Table of Contents • Python High or Low Level Language? • Function vs. Method • Nested For Loop • Assignment 1_3 & 1_4 • Practice MidTerm • Questions www.michaelliut.ca/cs1md3

  3. High vs. Low Level Languages • PYTHON IS AHIGH LEVEL LANGUAGE • High Level Language • Allows programmers to write algorithms, loops, and functions/methods without detailed knowledge of the hardware • Examples: C, C++, Java, and Python • Low Level Language • Requires detailed knowledge of machine level coding: involvement with registers, interrupts, etc.. • Example: MARIE Simulator www.michaelliut.ca/cs1md3

  4. Functions vs. Methods • A function is a piece of code that can pass data through it (in the form of a parameter) and can return data (optional). • A method is a piece of code that is associated with an object defined in the class. Two key elements: • A method is implicitly passed • A method is able to operate on data contained within the class www.michaelliut.ca/cs1md3

  5. Nested For Loop • A for loop within a for loop • An inner loop enclosed inside an outer loop • Textbook pages 143-144 • Example Program www.michaelliut.ca/cs1md3

  6. www.michaelliut.ca/cs1md3

  7. www.michaelliut.ca/cs1md3

  8. Assignment 1_3 & 1_4Solutions www.michaelliut.ca/cs1md3

  9. Assignment 1_3 www.michaelliut.ca/cs1md3

  10. Assignment 1_4 www.michaelliut.ca/cs1md3

  11. Practice MidTerm REAL TEST TOMORROW:Thu. Feb 13, 2014 at 16:30-17:20 in T28 www.michaelliut.ca/cs1md3

  12. Questions? www.michaelliut.ca/cs1md3

More Related