Introduction to OO Programming Andy Wang Object Oriented Programming in C++ COP 3330.

Slides:



Advertisements
Similar presentations
Chapter 1: Introduction
Advertisements

Overview1 History of Programming Languages n Machine languages n Assembly languages n High-level languages – Procedure-oriented – Object-oriented/Event-driven.
Chapter 10 Introduction to Objects and Classess 1.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
Lecture 3. Review (What is Class and Object ?) The world of JAVA contains objects The world of JAVA.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
Compiler Construction
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
CS130 Introduction to Programming with VB 6.0 Fall 2001.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Programming Languages and Paradigms Object-Oriented Programming.
Microsoft Visual Basic 2005: Reloaded Second Edition
1Object-Oriented Program Development Using C++ Computer Science and Programming Languages Computers are ubiquitous Computer literacy is essential Computer.
Hello World 2 What does all that mean?.
Introduction of C++ language. C++ Predecessors Early high level languages or programming languages were written to address a particular kind of computing.
CS101 Introduction to Computing Lecture Programming Languages.
Principles of Programming Languages Asst. Prof. Dr. Ahmet Sayar Spring-2012 Kocaeli University Computer Engineering Department Introduction.
Object Oriented Programming … and other things you need to program in java.
Chapter 6 Programming Languages. © 2005 Pearson Addison-Wesley. All rights reserved 6-2 Chapter 6: Programming Languages 6.1 Historical Perspective 6.2.
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
Chapter 6 Programming Languages © 2007 Pearson Addison-Wesley. All rights reserved.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
What is Programming? A program is a list of instructions that is executed by a computer to accomplish a particular task. Creating those instructions is.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Software Development Programming & Languages. Programming: A Five-Step Procedure Define the problem Design a solution Code the program Test the program.
Chapter 10 Classes and Objects In-Depth. Chapter 10 A class provides the foundation for creating specific objects, each of which shares the general attributes,
1 CMT2050: Object Oriented Programming and Design Dr. Xiaohong Gao Room 2C23 Ext ( Seminar Week 1) The.
1.
DOCUMENTATION SECTION GLOBAL DECLARATION SECTION
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
Overview Object oriented programming How to run a simple program.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
Introduction to OOP CPS235: Introduction.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 27 I Love this Class.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
 By the end of this lecture, you should …  Understand the three pillars of Object- Oriented Programming: Inheritance, Encapsulation and Polymorphism.
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
Computer Programming II Lecture 5. Introduction to Object Oriented Programming (OOP) - There are two common programming methods : procedural programming.
Why don’t programmers have to program in machine code?
Visit for more Learning Resources
Classes and OOP.
Andy Wang Object Oriented Programming in C++ COP 3330
Microsoft Visual Basic 2005: Reloaded Second Edition
Assembler, Compiler, Interpreter
Hello World 2 What does all that mean?.
Unit-2 Objects and Classes
High Level Programming Languages
Week 3 Object-based Programming: Classes and Objects
Assembler, Compiler, Interpreter
COP 3330 Object-oriented Programming in C++
Introduction to Object-Oriented Programming
CPS120: Introduction to Computer Science
Introduction to Computer Science
Presentation transcript:

Introduction to OO Programming Andy Wang Object Oriented Programming in C++ COP 3330

Programming Program A list of instructions for a computer to execute

Evolution of Programming Languages Machine languages Numeric operations

Evolution of Programming Languages Assembly languages Human readable shorthand for operations.file“test.c”.section.rodata.LC0:.string “hello\n”.text.globl main: push1%ebp movl%esp, %ebp sub1%8, %esp

Evolution of Programming Languages High-level procedural languages More readable Can divide the work into actions, represented by procedures and functions E.g., C, Pascal main() { int x = 1; int y = 1; int r = 1; DrawCircle(x, y, r); }

but…computers only understand machine languages… A compiler (e.g., g++) translates programs written in high-level languages to machine code instructions An interpreter translates and executes programs on the fly High level languages Compiler / interpreter Machine languages

Evolution of Programming Languages Object-oriented languages Also high-level Encapsulate or group data and procedures into objects E.g., C++, Java class Circle { public: SetCenter(int x, int y); SetRadius(int r); Draw(); private: int x, y, radius; };

Thus, … C is a high-level procedural programming language C++ is an object-oriented language based on C

Object Encapsulation of data and functions that act upon that data An object consists of Name (variable name) Attributes (member data) that describe what the object is Behavior (member functions) that describes what the object does

Class A blueprint for objects A user-defined type, consists of Declaration (typically in.h files) Definition (typically in.cc files) An object is an instance of a class Can create many objects from the same class Can build many houses from the same blueprint

What’s special about objects? In C, a struct consists of a name (variable) and attributes (data inside the struct) Data and functions are separate In C++ Can build objects that encapsulate data and functions Can use classes as reusable program building blocks