ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Spring 2013 Lecture 1: Introduction.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
L1:CSC © Dr. Basheer M. Nasef Lecture #1 By Dr. Basheer M. Nasef.
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
Visual and Internet Programming using JAVA
Three types of computer languages
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Chapter 8 The Tower of Babel. Chapter Outline Procedural languages Fortran, COBOL, PASCAL, C, Ada Object-oriented programming Special-purpose languages.
 2002 Prentice Hall. All rights reserved. Week 1 - Introduction to Object- Oriented Programming Outline 1.1 Machine Languages, Assembly Languages and.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 1 Introduction.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
C++ fundamentals.
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
COMPUTER PROGRAMMING. Introduction to C++ History Merges notions from Smalltalk and notions from C The class concept was borrowed from Simular67 Developed.
CS102 Introduction to Computer Programming
 2003 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
© Copyright 2013 by Pearson Education, Inc. All Rights Reserved. 1 Chapter 1 Introduction to Computers, Programs, and C++
 2008 Pearson Education, Inc. All rights reserved. 1 The chief merit of language is clearness. — Galen Our life is frittered away by detail…. Simplify,
 2005 Pearson Education, Inc. All rights reserved. 1 Introduction & The Java Virtual Machine Small Java Chapter 1 1.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
Object Oriented Programming Lecturer: Andreas P. Adi
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction to Computer Science.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
CPCS  Problem Solving in Everyday Life  Types of Problems  Problem Solving with Computers  Difficulties with Problem Solving 0-3.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Programs,
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 1 – Car Payment Calculator and Guess the Number.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
Chapter 1 Introduction to Java 10/8/2015 Lecture 1 1.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 1 Introduction.
 2002 Prentice Hall. All rights reserved. Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a Computer?
Chapter 1: Introduction to Programs, and Java 1. Objectives To review programs (§ ). To understand the relationship between Java and the World Wide.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Programs.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introduction to Computers Outline 1.1Introduction.
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 2: Software Design Cycle.
Liang, Introduction to C++ Programming, (c) Chapter 1 Introduction to Computers, Programs, and C++
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
CHAPTER 1.1 INTRODUCTION TO COMPUTERS AND C++ Dr. Shady Yehia Elmashad.
1 Chapter 1 Java –Originally for intelligent consumer-electronic devices –Then used for creating Web pages with dynamic content –Now also used for: Develop.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 1 Introduction to Computers,
Introduction to computer programming
CHAPTER 1 INTRODUCTION TO COMPUTERS, PROGRAMS, AND PYTHON 1.
Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a Computer? 1.3 Computer Organization 1.4 Evolution.
Foundations of Computer Science C & C++ programming lecture 2
Chapter 1 Introduction to Computers, Programs, and C++
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Objectives To review computer basics, programs, and operating systems (§ ). (Optional) To represent numbers in binary, decimal, and hexadecimal (§1.5.
Chapter 1 – Introduction to Computers, the Internet, and the Web
Chapter 1 Introduction to Computers, Programs, and C++
CSCI-235 Micro-Computer Applications
Chapter 1 Introduction to Computers, Programs, and Java
Chapter 1 – Introduction to Computers, the Internet, and the Web
Chapter 1 – Introduction to Computers, the Internet, and the Web
Chapter 1 Introduction to Computers, Programs, and C++
Chapter 1 – Introduction to Computers, the Internet, and the Web
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Spring 2013 Lecture 1: Introduction

12/18/2015 ECE 264: Lecture 1 2 What you should learn in this class An understanding, at an introductory level, of the use of objects in requirements, design, implementation, test, and maintenance of software systems The ability to write C++ programs The dynamics of working as a team on a project that covers all of the object life cycle The basics of the software / system process · To understand the interconnection of the CPU, memory, and I/O

What you’ll really learn … ? 12/18/2015 ECE 264: Lecture 1 3

12/18/2015 ECE 264: Lecture 1 4 Tentative course outline Brief intro to object-oriented programming Software life cycle  We’ll introduce in lecture 2; revisit frequently Class basics: constructors, methods, members Arrays, vectors, and other container classes Destructors, pointers, and dynamic memory allocation Strings Extending classes  Operator overloading  Inheritance  Polymorphism (virtual functions, abstract classes) Note: basic programming concepts will be reviewed as needed: control statements, data types, operators, functions

5 What is a Computer? A computer consists of a CPU, memory, hard disk, monitor, printer, and communication devices.

6 Programs Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs. Without programs, a computer is an empty machine. Computers do not understand human languages, so you need to use computer languages to communicate with them. Programs are written using programming languages.

7 Programming Languages Machine Language Assembly Language High-Level Language Machine language is a set of primitive instructions built into every computer. The instructions are in the form of binary code, so you have to enter binary codes for various instructions. Program with native machine language is a tedious process. Moreover the programs are highly difficult to read and modify. For example, to add two numbers, you might write an instruction in binary like this:

8 Programming Languages Machine Language Assembly Language High-Level Language Assembly languages were developed to make programming easy. Since the computer cannot understand assembly language, however, a program called assembler is used to convert assembly language programs into machine code. For example, to add two numbers, you might write an instruction in assembly code like this: ADDF3 R1, R2, R3

9 Programming Languages Machine Language Assembly Language High-Level Language The high-level languages are English-like and easy to learn and program. For example, the following is a high-level language statement that computes the area of a circle with radius 5: area = 5 * 5 * ;

10 Popular High-Level Languages COBOL (COmmon Business Oriented Language) FORTRAN (FORmula TRANslation) BASIC (Beginner All-purpose Symbolic Instructional Code) Pascal (named for Blaise Pascal) Ada (named for Ada Lovelace) C (whose developer designed B first) Visual Basic (Basic-like visual language developed by Microsoft) Delphi (Pascal-like visual language developed by Borland) C++ (an object-oriented language, based on C) Java (a popular object-oriented language, similar to C++) C# (a Java-like developed by Microsoft)

11 Compiling Source Code A program written in a high-level language is called a source program. Since a computer cannot understand a source program. Program called a compiler is used to translate the source program into a machine language program called an object program. The object program is often then linked with other supporting library code before the object can be executed on the machine.

12 History of C++ C, C++, Java, and C# are very similar. C++ evolved from C. Java was modeled after C++. C# is a subset of C++ with some features similar to Java. If you know one of these languages, it is easy to learn the others. C evolved from the B language and the B language evolved from the BCPL language. BCPL was developed by Martin Richards in the mid-1960s for writing operating systems and compilers. C++ is an extension of C, developed by Bjarne Stroustrup at Bell Labs during C++ added a number of features that improved the C language.

Why C++? C++ embodies the dominant computing paradigm, Object-Oriented Programming (OOP). Object-oriented programming techniques are more natural than structured programming. You’ll learn both since OOP is built upon structured programming. Learning C++ also teaches you an enhanced form of C. Advanced computing topics (operating systems, etc) are typically and more efficiently implemented in C/C++. Legacy migration of systems from C to C++ (30+ years of C code to migrate to C++ means jobs!). Contrary to popular belief, it’s fun!

Why object-oriented programming? Object orientation  A natural way of thinking about the world and computer programs Object-oriented design (OOD)  Models real-world objects in software  Models communication among objects  Encapsulates attributes and operations (behaviors) Information hiding Communication through well-defined interfaces Object-oriented language  Programming in object oriented languages is called object- oriented programming (OOP)  C++ is an object-oriented language Programmers can create user-defined types called classes  Contain data members (attributes) and member functions (behaviors) 1412/18/2015 ECE 264: Lecture 1

What are objects? Reusable software components that model real world items Meaningful software units  Time objects, paycheck objects, record objects, etc.  Any noun can be represented as an object Objects have attributes  Size, shape, color, weight, etc. Exhibit behaviors  Babies cry, crawl, sleep, etc.; cars accelerate, brake, turn, etc. More understandable, better organized and easier to maintain than procedural programming Libraries of reusable software  MFC (Microsoft Foundation Classes) 1512/18/2015 ECE 264: Lecture 1

Object-oriented design Object-Oriented Analysis and Design (OOAD)  Analyze program requirements, then develop solution  Essential for large programs  Plan in pseudocode or UML Unified Modeling Language (UML)  Graphical language that uses common notation  Allows developers to represent object-oriented designs 1612/18/2015 ECE 264: Lecture 1

12/18/2015 ECE 264: Lecture 2 17 Pretest review Pretest intended to review the following  Control structures (if/else, switch, loops)  Basic data types  Array accesses  C output First three topics use exactly the same syntax in C++! We’ll cover C++ output starting in lecture 3

Pretest review: if/else statements int x, y;. if (x < 5) { y = x + 1; } else { y = x – 2; } 1. At the end of the if/else statement above, if x = 4, y is equal to: a. 1b. 2 c. 4d Now, if x = 5, y is equal to: a. -2b. 3 c. 5d. 6 12/18/2015 ECE 264: Lecture 2 18

Pretest review: loops int x = 1; int i = 0; while (i <= 3) { x = x * 2; i++; } 3. Fill in the blank: The body of the while loop executes ______ times. a. 2b. 3 c. 4 d. an infinite number of 4. The final value of x is: a. 2b. 3 c. 8 d Which of the following is a for loop that can replace the while loop and produce the same result for x? a. for (i = 1; i < 4; i++) b. for (i = 0; i < 3; i++) c. for (x = 0; x <= 3; x++) d. for (i = 3; i >= 0; i--) 12/18/2015 ECE 264: Lecture 2 19

Pretest review: arrays, I/O int A[5] = {0, 7, 13, 12, 5}; for (i = 0; i < 5; i++) { printf(“A[%d] + 3 = %d\n”, i, A[i] + 3); } 6. In the first iteration, the program will display the following text on the screen: a. A[%d] + 3 = %d\n b. A[i] + 3 = A[i] + 3 c. A[0] + 3 = 3 d. A[1] + 3 = The value of A[4] is: a. 4 b. 5 c. 12 d. non-existent 12/18/2015 ECE 264: Lecture 2 20 Notes:

Pretest review: switch statements switch (var) { case 0: case 1: x = x + var; break; case 2: x = x – var; case 3: x = x * var; break; default: x = var; } Assume x always equals 5 at the start of the switch statement. What is the value of x at the end of the statement if: 8. var = 1? a. 1b. 4 c. 5 d var = 2? a. 2b. 3 c. 6 d var = 5? a. 0 b. 5 c. 10 d /18/2015 ECE 264: Lecture 2 21

Next Software design cycle  General overview Software engineering steps Types of testing Requirements specifications  Introduce UML, use case diagrams Applying design cycle to ECE 264 C++ basics 12/18/2015 ECE 264: Lecture 2 22