CIT241 Prerequisite Knowledge ◦ Variables ◦ Operators ◦ C++ Syntax ◦ Program Structure ◦ Classes  Basic Structure of a class  Concept of Data Hiding.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Advertisements

COMP 121 Week 7: Object-Oriented Design and Efficiency of Algorithms.
Lecture 3 Feb 4 summary of last week’s topics and review questions (handout) Today’s goals: Chapter 1 overview (sections 1.4 to 1.6) c++ classes constructors,
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Object-Oriented Design & Programming Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
COMP 171 Data Structures and Algorithms Tutorial 1 Template and STL.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Object Oriented Programming.  OOP Basic Principles  C++ Classes  September 2004  John Edgar 22.
1 CMSC 132: Object-Oriented Programming II Software Development IV Department of Computer Science University of Maryland, College Park.
Software Engineering Principles and C++ Classes
CS 2511 Fall Features of Object Oriented Technology  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance.
ASP.NET Programming with C# and SQL Server First Edition
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
CSE 332: C++ Classes From Procedural to Object-oriented Programming Procedural programming –Functions have been the main focus so far Function parameters.
CSE 332: C++ templates and generic programming I Motivation for Generic Programming in C++ We’ve looked at procedural programming –Reuse of code by packaging.
OOP Languages: Java vs C++
Object Based Programming. Summary Slide  Instantiating An Object  Encapsulation  Inheritance  Polymorphism –Overriding Methods –Overloading vs. Overriding.
Object Oriented Software Development
Programming Languages and Paradigms Object-Oriented Programming.
Object Oriented Analysis By: Don Villanueva CS 524 Software Engineering I Fall I 2007 – Sheldon X. Liang, Ph. D.
Chapter 4 Objects and Classes.
Introduction to Object-oriented programming and software development Lecture 1.
CIT241 Prerequisite Knowledge ◦ Variables ◦ Operators ◦ C++ Syntax ◦ Program Structure ◦ Classes  Basic Structure of a class  Concept of Data Hiding.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Custom Templatized Data Structures.
CS352-Week 2. Topics Heap allocation References Pointers.
Object Oriented Design and Programming Alan Goude Room: Sheaf 9323.
COMP 121 Week 7: Object-Oriented Design and Efficiency of Algorithms.
1 Chapter 10: Data Abstraction and Object Orientation Aaron Bloomfield CS 415 Fall 2005.
Object-Oriented Analysis and Design An Introduction.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13: Introduction to Classes.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Java Objects and Classes. Overview n Creating objects that belong to the classes in the standard Java library n Creating your own classes.
Data Structures Using C++1 Chapter 1 -Software Engineering Principles -ADT and Classes.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Object-Oriented Analysis and Design. Lesson 1: Introduction to Software Engineering.
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
Introduction to OOAD and the UML
Data Structures Using C++ 2E
Object-Oriented Programming Chapter Chapter
1 OOP - An Introduction ISQS 6337 John R. Durrett.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
Cramming for CS 247. FAQ Q: Will you post these slides online? A: Yes.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
04 - OOD Intro.CSC4071 Software Design ‘Requirements’ defines –The goals the system needs to satisfy. ‘Specification’ defines –The externally-observable.
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
Glenn Stevenson CSIS 113A MSJC CSIS 123A Lecture 3 Vectors.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 13: Introduction to Classes.
Data Structures Using Java1 Chapter 1 Software Engineering Principles and Java Classes.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
The Movement To Objects
CS 215 Final Review Ismail abumuhfouz Fall 2014.
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Review: Two Programming Paradigms
About the Presentations
Introduction to Classes
Object-Orientated Programming
CS360 Windows Programming
Introduction to Classes
Introduction to Computer Science for Majors II
Review CSE116 2/21/2019 B.Ramamurthy.
Copyright 2007 Oxford Consulting, Ltd
Presentation transcript:

CIT241 Prerequisite Knowledge ◦ Variables ◦ Operators ◦ C++ Syntax ◦ Program Structure ◦ Classes  Basic Structure of a class  Concept of Data Hiding  Concept of Inheritance  Concept of Polymorphism

CIT241 Objectives Study of data structures and algorithms Use of STL ◦ Containers ◦ Iterators ◦ Algorithms  Searching  Sorting  Other Use of C++11 new instructions ◦ Auto, Array, lambda, intelligent pointers, tuples

Why C++ Where is it being used ◦ Real-time systems  Embedded products ◦ Building tools  OSs  Compilers  Tools for developers / designers ◦ Games Reasons ◦ Speed ◦ Closeness to machine architecture (Native) See

Programming Languages Java ◦ Write once, run anywhere (there’s a JVM) ◦ Huge framework ◦ Garbage collection.NET – C# and VB ◦ Write once, run anywhere (there’s Windows) ◦ Huge framework ◦ Separation of concerns – visual designers / developers ◦ Garbage collection C++ ◦ Compilers for most machines ◦ Differences – machine architecture, OS services ◦ Stack and Heap ◦ Automatic deallocation using smart pointers ◦ Commercial libraries provide good amount of frameworks

Software Design Software Life Cycle ◦ Analysis – the What ◦ Design – the How ◦ Implementation – the Code ◦ Testing and debugging – the Quality

Survey from CodeProject

Design Methodologies Structured design ◦ Waterfall methodology ◦ Data Flow Diagrams, Structure Charts, HIPO diagrams, Pseudo Code ◦ Functional decomposition Object-Oriented design ◦ Iterative and Incremental design ◦ UML – use cases, class diagrams, sequence charts, state diagrams, packages ◦ Object decomposition

Agile Methodologies Do only what is necessary ◦ Capture requirements at a high level ◦ Develop small, incremental releases and iterate Write tests before code Refactor code Pair programming

Algorithms More than one approach Deals with trade-offs ◦ Memory space ◦ Processing time ◦ Simplicity of code Study of Data Structures and Algorithms ◦ Containers ◦ Functions ◦ Searching and Sorting

Big-O Notation Efficiency of an algorithm Interested in asymptotic behavior ◦ Especially as it approaches infinity Measure number of operations How does number of operations grow as number of elements grow

Growth Rates nlog 2 nn log 2 nn2n2 2n2n , ,294,967,296

Searching Linear search Binary search Cost of two methods ◦ Frequency of adding new element ◦ Frequency of searching for an element

Classes and Objects Class represents a type of object ◦ Extensible programming language ◦ Encapsulates state and behavior ◦ Reusable ◦ Classes used to model problem Objects are the instances ◦ Data members represent current state of a single object ◦ Behavior is shared by all objects of a class

Determining Classes Problem Domain ◦ Vision ◦ Use cases or scenarios Nouns as potential classes CRC cards ◦ Responsibility Sequence diagrams ◦ Actor interacting with Interface class(es) ◦ Interface class interacting with domain classes

Relationships between Classes Has a – composition Is a – inheritance Uses – association Relationships have multiplicity ◦ 1 – 1 ◦ 1 – Many ◦ Many – Many ◦ Many(s) in model most often held in container

Class Data members ◦ Fields  Static Field Member functions ◦ Accessors and mutators  Standard C++ does not support properties  Implements get and set functions ◦ Static member functions Accessibility ◦ Private ◦ Protected ◦ Public

Class Methods Constructors ◦ Constructors with default parameters Destructor Public Private Built-in Operations ◦ member access (.) or (->) for dynamic objects ◦ assignment (=)

Patterns Model/View/Controller - Separation of concerns ◦ Data part ◦ Presentation part ◦ Control part – handle requests / events Data Persistence ◦ Separate data from storing/retrieving of data

Date Class How is it going to be used? Methods ◦ Constructors ◦ Destructor? ◦ Set/Get functions ◦ Calculation functions ◦ Formatting functions

Vectors Vector is a dynamic array ◦ Can grow or shrink as needed Vector is part of STL, hence uses template vector intvect; vector studentvect(24); void push_back(const T& newelem); T& operator[ ](size_type n); const T& operator[ ](size_type n) const; T& at(size_type n); const T& at(size_type n) const;

Accessing the elements Regular for loop, range for loop For loop for (int ndx = 0; ndx < vint.size(); ++ndx) { cout << vint[ndx] << endl; } for (auto iter = vint.begin(); iter != vint.end(); ++iter) { cout << *it << endl; } Range for loop for (int curr : vint) { cout << curr << endl; }

Project 1 Simple ToDoList Application Need to capture an activity that has a description and a planned completion date. Need to have the ability to add an increment to the date for an activity. The increment can be both negative and positive. We would also like to capture the difference between two date values. We need to record the actual completion date element for an activity as well as its planned completion date value.