Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 5.

Slides:



Advertisements
Similar presentations
Chapter 13 – Introduction to Classes
Advertisements

Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Introduction to Information and Computer Science Computer Programming Lecture e This material (Comp4_Unit5e) was developed by Oregon Health and Science.
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)
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
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.
Introduction to Object-oriented programming and software development Lecture 1.
An Object-Oriented Approach to Programming Logic and Design
BIT 1003 – Presentation 7. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
Introduction to Information and Computer Science Computer Programming Lecture d This material (Comp4_Unit5d) was developed by Oregon Health and Science.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 2 This material was developed by Oregon Health & Science.
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 2.
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.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 3 This material was developed by Oregon Health & Science.
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.
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”
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
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.
Introduction to Classes, Objects, Methods and Attributes Lecture # 5.
CPS120: Introduction to Computer Science Lecture 16 Data Structures, OOP & Advanced Strings.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
CSCE 240 – Intro to Software Engineering Lecture 3.
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.
Seventh step for Learning C++ Programming CLASS Declaration Public & Private Constructor & Destructor This pointer Inheritance.
1 Design Object Oriented Solutions Object Oriented Analysis & Design Lecturer: Mr. Mohammed Elhajj
Introduction to Java Chapter 1 - Introduction to Java1 Chapter 1 Introduction to Java.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Visit for more Learning Resources
Object Oriented Programming
Introduction to Computer Science
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Objects First with Java A Practical Introduction using BlueJ
Introduction to Computer Science
Systems Analysis and Design With UML 2
Objects as a programming concept
OOP What is problem? Solution? OOP
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Creating and Using Classes
CSC 205 Programming II Lecture 2 Subclassing.
Objects First with Java A Practical Introduction using BlueJ
Objects First with Java A Practical Introduction using BlueJ
Introduction to Object-Oriented Programming
CPS120: Introduction to Computer Science
Lecture 8 Object Oriented Programming (OOP)
Introduction to Computer Science and Object-Oriented Programming
Introduction to Object-Oriented Concepts
Presentation transcript:

Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 5 This material was developed by Oregon Health & Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number IU24OC

Unit 5 Objectives a)Define the purpose of programming languages. b)Define the different types of programming languages. c)Explain the continuum of programming languages from machine code and assembly languages through scripting languages and high level structured programming languages. d)Explain the compiling and interpreting process for computer programs. e)Use the following components of programming languages to build a simple program: variables, loops and conditional statements. f)Introduce additional programming concepts such as objects and modularity. Component 4/Unit 5-52 Health IT Workforce Curriculum Version 2.0/Spring 2011

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 Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring

Objects Objects have –Identity (name) –Attributes (instance variables) –Behavior (methods) Way of organizing code –Data and related methods stored together Allows for code reuse –Modularity –Inheritance Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring

Classes vs. Objects Classes are the code definition for objects They are the "blueprint" Objects are created when the program runs –Instantiation –Similar to declaring a variable Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring

Procedural vs. OOP double circleArea(double radius) { return 3.14*radius*radius; } class Circle { double radius; void setRadius(double rValue) { radius = rValue; } double calcArea() { return 3.14*radius*radius; } Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring In class, radius is stored with the calcArea method In procedure, radius is passed into calcArea as a parameter How would we add circumference calculation?

OOP Designs Programs are designed using tools UML (Unified Modeling Language) is very common Example for class of BMICalculator Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring BMICalculator double weight double height double bmi void setWeight(double wValue) void setHeight(double hValue) void calcBmi() void outputBmi() void outputBmiCategory()

Inheritance Inheritance is a powerful feature of OOP Classes can inherit methods and instance variables Makes coding less redundant Allows for polymorphism Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring

Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring 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() Child classes inherit all methods and instance variables from parent class

Modularity Separation of code into components such as objects Non object oriented languages implement modularity –Procedures Allows for –reuse of code –maintainability Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring

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 & documentation Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring

Unit Summary In this unit, you learned –The purpose of programming languages –Different types of programming languages –The compilation/interpreter process –Programming language constructs –Object Oriented Programming (OOP) Gained an understanding –How programs are designed and implemented –What code looks like –What objects are and why they are used Component 4/Unit 5-5 Health IT Workforce Curriculum Version 2.0/Spring