Introduction to Information and Computer Science Computer Programming Lecture e This material (Comp4_Unit5e) was developed by Oregon Health and Science.

Slides:



Advertisements
Similar presentations
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
Advertisements

Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
Introduction to Information and Computer Science Computer Programming Lecture a This material (Comp4_Unit5a) was developed by Oregon Health and Science.
Systems Analysis and Design 8th Edition
Object-Oriented Analysis and Design
Chapter 1 Object-Oriented System Development
Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
Object Oriented System Development with VB .NET
Objects First with Java A Practical Introduction using BlueJ
Basic OOP Concepts and Terms
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
ASP.NET Programming with C# and SQL Server First Edition
Chapter 13: Object-Oriented Programming
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
INTRODUCTION TO JAVA PROGRAMMING Chapter 1. What is Computer Programming?
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Introduction To System Analysis and design
Introduction to Information and Computer Science Computer Programming Lecture c This material (Comp4_Unit5c), was developed by Oregon Health and Science.
Programming Languages and Paradigms Object-Oriented Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Introduction to Object-oriented programming and software development Lecture 1.
An Object-Oriented Approach to Programming Logic and Design
Introduction to Information and Computer Science Information Systems Lecture b This material (Comp4_Unit9b) was developed by OHSU, funded by the Department.
Introduction to Information and Computer Science Computer Programming Lecture d This material (Comp4_Unit5d) was developed by Oregon Health and Science.
CHAPTER ONE Problem Solving and the Object- Oriented Paradigm.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Introduction to Information and Computer Science Information Systems Lecture c This material (Comp4_Unit9c) was developed by OHSU, funded by the Department.
Java Classes Using Java Classes Introduction to UML.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 2 This material was developed by Oregon Health & Science.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Chapter 8. About the Midterm Exam.. Exam on March 12 Monday (Tentatively) Review on March 7 Wednesday Cover from Chapter 6 Grades will be out before spring.
Introduction to Information and Computer Science Computer Programming Lecture b This material (Comp4_Unit5b), was developed by Oregon Health and Science.
Object Oriented Programming Principles Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-3.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 3 This material was developed by Oregon Health & Science.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 4.
Component 4: Introduction to Information and Computer Science Unit 9: Components and Development of Large Scale Systems Lecture 3 This material was developed.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
Lecture 12 March 16, The Scope of a Variable What if there are two variables with the same name? –A local or block-local variable can have the same.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 2.
CS 3050 Object-Oriented Analysis and Design. Objectives What is “Object-Oriented?” Object-Oriented Approach Vs. Structured Approach How Has the Object-Oriented.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 5.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 3.
Inheritance CSI 1101 Nour El Kadri. OOP  We have seen that object-oriented programming (OOP) helps organizing and maintaining large software systems.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Introduction to OOP CPS235: Introduction.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter More on Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Introduction to Classes, Objects, Methods and Attributes Lecture # 5.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Introduction to Information and Computer Science Databases and SQL Lecture d This material (Comp4_Unit6d) was developed by Oregon Health & Science University,
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
1 Design Object Oriented Solutions Object Oriented Analysis & Design Lecturer: Mr. Mohammed Elhajj
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Introduction to Computer Science
Objects First with Java A Practical Introduction using BlueJ
Introduction to Computer Science
Objects as a programming concept
COS 260 DAY 2 Tony Gauvin.
Objects First with Java A Practical Introduction using BlueJ
Basic OOP Concepts and Terms
Objects First with Java A Practical Introduction using BlueJ
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

Introduction to Information and Computer Science Computer Programming Lecture e This material (Comp4_Unit5e) was developed by Oregon Health and Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number IU24OC

Computer Programming Learning Objectives Define the purpose of programming languages. (Lecture a) Differentiate between the different types of programming languages and list commonly used ones. (Lecture a) Explain the compiling and interpreting process for computer programs. (Lecture b) Learn basic programming concepts including variable declarations, assignment statements, expressions, conditional statements and loops. (Lectures c, d) Describe advanced programming concepts including objects and modularity. (Lecture e) 2 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Object-Oriented Programming Object-oriented programming (OOP) is a paradigm Very popular today –C++, C#, Java, Python, Ruby Supports software engineering principles Graphical user interface (GUI) programming naturally conforms to OOP 3 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Objects Objects have –Identity (name) –Attributes (instance variables) –Behavior (methods) OOP is a way of organizing code –Data and related methods stored together OOP allows for code reuse –Modularity –Inheritance 4 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Classes vs. Objects Classes are the code definition for objects They are the "blueprint“ for objects Objects are created when the program runs –Instantiation –Similar to declaring a variable 5 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Procedural vs. OOP double circleArea(double radius) { return 3.14*radius*radius; } } In class, radius is stored with the calcArea method In procedure, radius is passed into calcArea as a parameter How to add circumference calculation? class Circle { double radius; void setRadius(double rValue) { radius = rValue; } double calcArea() { return 3.14*radius*radius; } 6 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

OOP Designs Programs are designed using tools UML (Unified Modeling Language) is very common Example for class of BMICalculator BMICalculator double weight double height double bmi void setWeight(double wValue) void setHeight(double hValue) void calcBmi() void outputBmi() void outputBmiCategory() 5.2 Table: BMI Calculator 7 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Inheritance Inheritance is a powerful feature of OOP Classes can inherit methods and instance variables Makes coding less redundant Allows for polymorphism 8 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

BankingAccount String accountNum double balance void setAccountNum(double aValue) void setBalance(double bValue) double getBalance() void printAccountInfo() CheckingAccount double overdraft void setOverdraft(double oValue) double getOverdraft() SavingsAccount double interestRate void setInterestRate (double iValue) void accrueInterest() UML Diagram: Inheritance 5.3 Figure: Child classes inherit all methods and instance variables from parent class 9 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Modularity Separation of code into components such as objects Non-OOP languages implement modularity –Procedures Allows for –Reuse of code –Maintainability 10 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Encapsulation Objects can declare methods and instance variables to be private or public –Typically, instance variables are private –Some (all) methods are public Class definition controls –Valid ranges for values –Rules for setting values, calling methods –Details of implementation are hidden Interface is public methods and documentation 11 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Computer Programming Summary – Lecture e This lecture introduced: –Object-oriented programming –Inheritance –Modularity –Encapsulation –Differences between classes and objects 12 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Computer Programming Summary This unit covered: –The purpose of programming languages –Different types of programming languages –The compilation/interpreter process –Programming language constructs –Object-oriented programming (OOP) –How programs are designed and implemented –What code looks like –What objects are and why they are used 13 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e

Computer Programming References – Lecture e References Eck, David. (2011) Introduction to Programming Using Java, Sixth Edition. [updated 2011 Jul 18; cited 2011 Nov 13]: Available from: Lesson: Object-Oriented Programming Concepts inThe Java Tutorials. (2011). Retrieved 2011 Nov 13 from: Morley Deborah, Parker Charles S. (2010). Chapter 13: Program Development and Programming Languages. In: Understanding Computers Today and Tomorrow.12 th ed. Boston: Course Technology. Parsons JJ, Oja D. (2010). Chapter 12: Computer Programming. In: New Perspectives on Computer Concepts 2011: Comprehensive. 13th ed. Boston: Course Technology. The Java Language: An Overview. [Webpage]. c [updated 2007 Dec 17; cited 21 March 2011]. Available from: Sierra Kathy, Bates Bert. (2009). Head First Java, Second Edition. O’Reilly Media. Charts, Tables, Figures 5.2 Table: BMI Calculator (Hribar, 2011) 5.3 Figure: Child classes inherit all methods and instance variables from parent class (Hribar, 2011). 14 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Computer Programming Lecture e