CS2006 - Data Structures I Chapter 2 Principles of Programming & Software Engineering.

Slides:



Advertisements
Similar presentations
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advertisements

COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
Problem Solving and Algorithm Design
Chapter 6 Problem Solving and Algorithm Design. 6-2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
Introduction to Object Oriented Programming Java.
Ch 12: Object-Oriented Analysis
Object-Oriented Analysis and Design
1 Chapter 1 Object-Oriented Programming. 2 OO programming and design Object-oriented programming and design can be contrasted with alternative programming.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Department of Computer Science University of Maryland, College Park
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
Fall 2007CS 2251 Software Engineering Intro. Fall 2007CS 2252 Topics Software challenge Life-cycle models Design Issues Documentation Abstraction.
Chapter 1 Principles of Programming and Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Software Engineering Principles and C++ Classes
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Data Abstraction: The Walls
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© The McGraw-Hill Companies, 2006 Chapter 7 Implementing classes.
C++ fundamentals.
Introduction to Methods
BACS 287 Basics of Object-Oriented Programming 1.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Programming Languages and Paradigms Object-Oriented Programming.
Object-Oriented Software Testing. C-S 5462 Object-Oriented Software Testing Research confirms that testing methods proposed for procedural approach are.
Introduction to Object-oriented programming and software development Lecture 1.
Chapter 3 Introduction to Collections – Stacks Modified
Introduction Ellen Walker CPSC 201 Data Structures Hiram College.
Object Oriented Programming CSI 1101 Nour El Kadri.
More with Methods (parameters, reference vs. value, array processing) Corresponds with Chapters 5 and 6.
Object Oriented Programming ITI 1121 Nour El Kadri.
Features of Object Oriented Programming Lec.4. ABSTRACTION AND ENCAPSULATION Computer programs can be very complex, perhaps the most complicated artifact.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
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.
Data Structures Using C++1 Chapter 1 -Software Engineering Principles -ADT and Classes.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Design.ppt1 Top-down designs: 1. Define the Problem IPO 2. Identify tasks, Modularize 3. Use structure chart 4. Pseudocode for Mainline 5. Construct pseudocode.
April 24, 2017 Chapter 4 Data Abstraction The Walls
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Learners Support Publications Object Oriented Programming.
Abstraction ADTs, Information Hiding and Encapsulation.
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.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
12 OBJECT-ORIENTED DESIGN CHAPTER
Chapter 1 Data Abstraction: The Walls CS Data Structures Mehmet H Gunes Modified from authors’ slides.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Chapter 2 Principles of Programming and Software Engineering.
Data Structures Using Java1 Chapter 1 Software Engineering Principles and Java Classes.
1 CS 132 Spring 2008 Chapter 1 Software Engineering Principles and C++ Classes.
Unit 1 - Introducing Abstract Data Type (ADT) Part 1.
Principles of Programming & Software Engineering
Chapter 0: Introduction
Programming Logic and Design Seventh Edition
Principles of Programming and Software Engineering
About the Presentations
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Subprograms and Programmer Defined Data Type
Introduction to Data Structure
Chapter 2. Problem Solving and Software Engineering
Presentation transcript:

CS Data Structures I Chapter 2 Principles of Programming & Software Engineering

2 Topics Modular Design Concepts Abstraction OO Design Encapsulation Inheritance Polymorphism Top Down Design Structure Chart

3 Abstraction & Information Hiding Example: Cars brakes Client box Car Black box Push the brakes My interior design is using Cylinder brakes or Drum brakes Brake pedal pushed Car stop

4 Abstraction Abstraction separates the purpose of a module from its implementation. Example: Sorting Client box Sort Black box Sort this data please, I don’t care how you do it I can sort data into ascending order without you knowing how Unsorted data Sorted data

5 Procedural Abstraction Procedural Abstraction is the process of separating the purpose of a method from its implementation. Once written the method can be used without any knowledge of how it is implemented - only need to know the parameters. Example: nearly all methods in the entire Java API.

6 Abstract Data Types ADT - a collection of data along with a set of operations that can be performed on that data. No details about how the data is stored or how the operations on the data are implemented. An ADT is a general description of the design of a module with no details.

7 Abstract Data Types Data Structure - the implementation of an ADT in a programming language. The details of data storage and how operations are performed are crucial parts of a data structure.

8 ADT List Any List in general will allow the following operations: Create an empty list Destroy a list Determine whether a list is empty Determine the number of items in a list Insert an item at a given position in the list What else?

9 Object-Oriented Design Three elements to OOD: Encapsulation - combining data and operations within one object. Inheritance - objects can inherit data and/or methods from other objects. Polymorphism - objects can determine operations at execution time. Every object knows its "true" type regardless of type casting

10 Inheritance A class can inherit the variables and methods of another class. It can keep those it wants and replace those it doesn’t. Example: our Person class. we want a class of students. we can’t change our Person class because many people are using it as it stands perhaps we don’t have access to the source code Create a new class called Student that extends the current class Person by the addition of a new variables and methods Person Student parent class super class child class subclass

11 Faculty Student Person Class design extend the definition of Person build a subclass for each specific type of person

12 Faculty Student Person Class hierarchy int getAge() String getName() float getGPA() void setId(String new_id) void setSalary(float newSalary) float getHoursWorked()

13 Object-Oriented Design Produce a collection of objects that have behaviours How to do Identifying the objects in the problem UML Contents of Software Engineering (cosc 4506)

14 Object-Oriented Design Consider the nouns and verbs in the problem domain Create a ATM machine which allow user to retrieve, deposit, transfer and check balance of their accounts ATM Account: account Open () Close() Account Type: String Amount: double transfer (int ) checkBalance() retrieve deposit ()

15 Top-Down Design Is a structured programming methodology Focused on algorithm design. Goal is to break a large problem into a set of smaller problems that are more easily solved.

16 Top-Down Design An attempt is made to solve a problem in terms of small subproblems Divide and Conquer strategy How?

17 Top-Down Design (TDD) Structure chart: Find Median Get middle scoreSort scoresRead Scores Read score From user Insert score into array

18 Structure Charts Can add some info into our structure chart to show how we share the data Two type of info that get passed between our methods Data Control Information or flags Thing like “perform such and such an operation” Or “ we have hit the end of file”

19 Structure Charts Use named arrows to show the data flow Data arrows Flag arrows

20 Structure Charts Structure chart: Find Median Get middle scoreSort scoresRead Scores

21 Structure Charts Structure chart: Find Median Get middle scoreSort scoresRead Scores Read score Insert score into array MarkEnrty: contain score and ID MarkArray: contain array of scores

22 Structure Charts Structure chart: Find Median Get middle scoreSort scoresRead Scores Read score Insert score into array EOF MarkEntry MarkEnrty: contain score and ID MarkArray: contain array of scores

23 Structure Charts Structure chart: Find Median Get middle scoreSort scoresRead Scores Read score Insert score into array EOF MarkEntry MarkEnrty: contain score and ID MarkArray: contain array of scores MarkArray

24 Structure Charts Structure chart: Find Median Get middle scoreSort scoresRead Scores Read score Insert score into array EOF MarkEntry MarkEnrty: contain score and ID MarkArray: contain array of scores MarkArray

25 Structure Charts The manner in which this structure diagram would be implemented as a program is obvious It is now possible to create a skeletal program with all the method headers All you need is to fill in detail

26 Structure Charts Public class FindMedian { public static void main (..) { } public static void readScore (int []MarkArray) { } public static void sortScore (int []MarkArray) {} public static int getMedian (int []MarkArray) {} }

27 Structure Charts public class FindMedian { public static void main (..) { int MarkArray []; } public static void readScore (int []MarkArray) { } public static void sortScore (int []MarkArray) {} public static int getMedian (int []MarkArray) {} }

28 Structure Charts public class FindMedian { public static void main (..) { int MarkArray []; readScore (MarkArray); } public static void readScore (int []MarkArray) { } public static void sortScore (int []MarkArray) {} public static int getMedian (int []MarkArray) {} }

29 Structure Charts public class FindMedian { public static void main (..) { int MarkArray []; readScore (MarkArray); sortScore (MarkArray); } public static void readScore (int []MarkArray) { } public static void sortScore (int []MarkArray) {} public static int getMedian (int []MarkArray) {} }

30 Structure Charts public class FindMedian { public static void main (..) { int MarkArray []; readScore (MarkArray); sortScore (MarkArray); getMedian (MarkArray); } public static void readScore (int []MarkArray) { } public static void sortScore (int []MarkArray) {} public static void getMedian (int []MarkArray) {} }