Teach A-Level Computer Science: Object-Oriented Programming in Python

Slides:



Advertisements
Similar presentations
Python Mini-Course University of Oklahoma Department of Psychology Lesson 26 Classes and Objects 6/16/09 Python Mini-Course: Lesson 26 1.
Advertisements

OBJECT ORIENTED PROGRAMMING M Taimoor Khan
CO320 Introduction to Object- Oriented Programming Michael Kölling 3.0.
CS102--Object Oriented Programming Lecture 10: – Abstract Classes Copyright © 2008 Xiaoyan Li.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Object Oriented Programming Class
Programming Languages and Paradigms Object-Oriented Programming.
Chapter 11 Introduction to Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Module Overview n Module Title: OO Programming n Module Code: MIT3446 n Module Value: 3.0 n Duration: 15 weeks n Class-Contact Hours: Lecture15 hrs n Lab/Tutor30hrs.
(C) 2000, The University of Michigan 1 Database Application Design Handout #10 March 17, 2000.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
Copyright © 2012 Pearson Education, Inc. 9/4/1435 h Sunday Lecture 1 Array’s Terminologies.
For loops in programming Assumes you have seen assignment statements and print statements.
Chapter 12 Object Oriented Design.  Complements top-down design  Data-centered view of design  Reliable  Cost-effective.
Overview The Basics – Python classes and objects Procedural vs OO Programming Entity modelling Operations / methods Program flow OOP Concepts and user-defined.
Introduction to Computing Using Python Namespaces – Local and Global  The Purpose of Functions  Global versus Local Namespaces  The Program Stack 
Methodology First and Language Second -A Way to Teach Object-Oriented Programming Haibin Zhu, PhD Department of Computer Science and Mathematics Nipissing.
Chapter More on Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Introduction to Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Computer Science 101 For Statement. For-Statement The For-Statement is a loop statement that is especially convenient for loops that are to be executed.
Introduction to C++ Course Version 1.0. Topics Course Outline Course Materials Syllabus Blackboard Forum Why C++
Exceptions and Handling
CSCI/CMPE 4341 Topic: Programming in Python Chapter 7: Introduction to Object- Oriented Programming in Python – Exercises Xiang Lian The University of.
Seventh step for Learning C++ Programming CLASS Declaration Public & Private Constructor & Destructor This pointer Inheritance.
CSC 108H: Introduction to Computer Programming Summer 2012 Marek Janicki.
Course Code : 15ECSC204 Object Oriented Progamming.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 3- Introduction to Object Oriented Programming concepts Topic 3.1 Fundamental Concepts.
IT 210 Week 5 DQ 1 To purchase this material link Week-5-DQ-1 For more courses visit our website
CMSC201 Computer Science I for Majors Lecture 25 – Classes
CSE202 Object Oriented Programing
Cen 112 C Programming Özgür Örnek.
Andy Wang Object Oriented Programming in C++ COP 3330
Today’s Objectives Review the important points of classes
OOP What is problem? Solution? OOP
Module 1
C++, OBJECT ORIENTED PROGRAMMING
Think What will be the output?
Object-Oriented Programming
Object-Orientated Programming
OBJECT ORIENTED PROGRAMMING overview
CSC 108H: Introduction to Computer Programming
Object Oriented Concepts
Object-oriented programming principles
Object-oriented programming
3 Fundamentals of Object-Oriented Programming
Object-oriented programming
CS190/295 Programming in Python for Life Sciences: Lecture 1
Object-oriented programming
Andy Wang Object Oriented Programming in C++ COP 3330
Inheritance Basics Programming with Inheritance
Teach A-Level Computer Science: Object-Oriented Programming in Python
Object Oriented Programming
Computer Programming with JAVA
The Programming Process
CSE Object Oriented Programing
Object Oriented Programming
C++ Programming ㅎㅎ String OOP Class Constructor & Destructor.
Session 2: Introduction to Object Oriented Programming
Systems Analysis and Design I
Object Oriented Programming in A Level
Introduction to Computer Science
2.1 Introduction to Object-Oriented Programming
A Level Computer Science Topic 6: Introducing OOP
Object Oriented Design & Analysis
ㅎㅎ Sixth step for Learning C++ Programming Pointer new, delete String
Object Oriented Programming (OOP)- Assist. Prof. Dr
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

Teach A-Level Computer Science: Object-Oriented Programming in Python Session 2 Theory: Variables, objects and Modules Practical: Creating and using Python modules

Course Outline Week No Understanding computers (5:30– 6:30) Developing programming skills (7:00 -8:00) Week-1 Week 1 – Introduction to Classes and Objects Week 1 – OOP Programming basics Week-2 Week 2 – Variables and objects, Python Modules Week 2- Creating and using Python modules Week-3 Week 3 – Encapsulation and Inheritance Week 3 – Programming using Inheritance Composition vs Inheritance Week-4 Week 4 - Polymorphism Week 4 – Different kinds of Polymorphism Week-5 Week 5 - Consolidation

Session -2 Outline Variables and Objects Understanding why we use Python Modules Creating and importing Python modules Example1: Shopping list Example2: Student report

Variables and Objects Are variables and objects the same? Variables we use do not contain any objects but they are pointers to objects in memory. Let us look at an example to understand this. Points to memory location of an object denotes both the objects are part of Dice class

Understanding the use of 1D Python list

Understanding the use of 2D python list

Python Modules Python module is a single Python file that can contain executable statements, classes, attributes as well as methods. Definitions from a module can be imported into other modules or into the main module. Let us use an example to understand this. Invoice Main Module Products and prices Customer details and payment method

Creating our First module customerdetails.py is our first module has Class Customer Methods customerdet and cashmethod Attributes self.customer,self.payment and self.money Activity1: Worksheet page1

Creating our Second module productsnew.py is our second module has Class Products Methods getproducts() Attributes (self.prodlist, self.product and self.item) Activity2: Worksheet page2

Creating our main program from filename import class invoicenew.py Activity 3: Worksheet page 3

Let us continue after break