1 Chapter-01 Introduction to Software Engineering.

Slides:



Advertisements
Similar presentations
Chapter 12 Separate Compilation and Namespaces. Abstract Data Type (ADT) ADT: A data type consisting of data and their behavior. The abstraction is that.
Advertisements

Chapter 13 – Introduction to Classes
Exercise 2.
Chapter 1: An Overview of Computers and Programming Languages
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 8, 2005.
COSC 120 Computer Programming
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 Introduction to Software Engineering Lecture 42 – Communication Skills.
 Monday, 9/30/02, Slide #1 CS106 Introduction to CS1 Monday, 9/30/02  QUESTIONS (on HW02, etc.)??  Today: Libraries, program design  More on Functions!
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Computer Programming 1 Problem Solving and Software Engineering.
Computer Science 1620 Programming & Problem Solving.
Chapter 1 Principles of Programming and Software Engineering.
Chapter 1: An Overview of Computers and Programming Languages
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Basic Elements of C++ Chapter 2.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages Updated by: Dr\Ali-Alnajjar.
Programming is instructing a computer to perform a task for you with the help of a programming language.
Software Engineering 1 (Chap. 1) Object-Centered Design.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
1 Programming and Problem Solving — Software Engineering (Read Chap. 2)
Programming and Problem Solving — Software Engineering (Read Chap. 2) 1.
Problem Solving and Software Engineering Chapter 1.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Libraries Making Functions Globally Reusable (§ 6.4) 1.
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
Creating Classes and Objects Chapter Microsoft Visual Basic.NET: Reloaded 1.
1 Chapter-01 Introduction to Software Engineering.
CHAPTER 7 DATA INPUT OUTPUT Prepared by: Lec. Ghader R. Kurdi.
Libraries 1 Making Functions Globally Reusable (§ 4.6)
1 Simple Functions Writing Reuseable Formulas. In Math Suppose f (x) = 2 x 2 +5Suppose f (x) = 2 x 2 +5 f(5)=?f(5)=? f(5) = 2* =55f(5) = 2*
Chapter 4: Subprograms Functions for Problem Solving Mr. Dave Clausen La Cañada High School.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
COSC1557: Introduction to Computing Haibin Zhu, PhD. Professor Department of Computer Science Nipissing University (C) 2014.
1 Original Source : and Problem and Problem Solving.ppt.
Control Structures (B) Topics to cover here: Sequencing in C++ language.
A first program 1. #include 2. using namespace std; 3. int main() { 4. cout
Software Engineering Object-Centered Design. Problem Solving Does anyone scuba dive? Let’s solve this scuba-diving problem: Write a program that, given.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 8/31/05CS150 Introduction to Computer Science 1 Hello World!
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Simple Functions Writing Reuseable Formulas. Problem Using OCD, design and implement a program that computes the area and circumference of an Australian.
Libraries Making Functions Reuseable. Review Last time, we wrote a program to compute the area and circumference of an ellipse. a a bb.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 27 I Love this Class.
11 Introduction to Object Oriented Programming (Continued) Cats.
1 Chapter-01 Introduction to Software Engineering.
Chapter 2 Principles of Programming and Software Engineering.
Libraries 1 Making Functions Globally Reusable (§ 6.4)
Software Engineering (Chap. 1) Object-Centered Design When we prepare a program, the experience can be just like composing poetry or music … My claim is.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
Principles of Programming & Software Engineering
Chapter 1: An Overview of Computers and Programming Languages
Engineering Problem Solving With C An Object Based Approach
Completing the Problem-Solving Process
Chapter 1: An Overview of Computers and Programming Languages
Principles of Programming and Software Engineering
Writing Reuseable Formulas
solve the following problem...
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1 Introduction(1.1)
Chapter 1: An Overview of Computers and Programming Languages
Object-Centered Design
Presentation transcript:

1 Chapter-01 Introduction to Software Engineering

2 Software Engineering Object-Oriented Design

3 Problem Solving Does anyone carpet? Let’s solve this area problem: –Write a program that, given a length and width, computes the area of a carpet.

4 Behavior A. Describe the desired behavior of the program: Our program should display a prompt for length and width of the carpet, read length and width of the carpet from the keyboard, compute the corresponding area, and display the area, along with a descriptive label on the screen.

5 Objects and Attributes B. Identify the nouns in the behavioral description (other than program and user): Our program should display a prompt for length and width of the carpet on the screen, read length and width of the carpet from the keyboard, compute the corresponding area, and display the area, along with a descriptive label on the screen. These make up the objects and data members in our program.

6 Operations C. Identify the verbs in the behavioral description: Our program should display a prompt for the length and width of the carpet on the screen, read the length and width from the keyboard, compute the corresponding area, and display the area, along with a descriptive label on the screen. These make up the operations in our program.

7 Algorithm D. Organize the objects and operations into a sequence of steps that solves the problem, called an algorithm. 1. Define the class carpet. 2. Create the object carpet_ Display a prompt for length and width on the screen Read length and width from the keyboard. 3. Compute area from length and width. 4. Display area, plus an informative label on the screen.

8 Coding Once we have designed an algorithm, the next step is to translate that algorithm into a high level language like C++. This involves figuring out how to –represent our objects, and –perform our operations, in C++ (with the aid of a book...)

9 Representing Objects A. Determine a type and name for each object:

10 Performing Operations B. Identify the C++ operator to perform a given operation, if there is one... To compute area, we need to find the area-length- width formula in a geometry book...

11 Length and Width-to-Area In a geometry book, we find that –area is the product of length and width

12 Operations (Revised)

13 Documentation Always begin a file with an opening comment: /* area.cpp is a area calculating utility. * Author: Bazlur Rasheed * Date: 02 July 2000 * Purpose: Calculate area of a rectangle. */

14 Coding: Defining class carpet /* area.cpp is a area calculating utility. *... */ class carpet{ public: carpet(); int cal_area(); private: int length, width; };

15 Coding: Defining class carpet //... carpet::carpet() { cout <<"\n Enter the length (meter) and” << “ width (meter)” << "\n seperated by a space and “ << “ followed by the enter key: ”; cin >> length >> width; } int carpet::cal_area() { return (length*width); }

16 Coding: Program Stub /* area.cpp is a area calculating utility. *... */ #include // cin, cout, > using namespace std; void main(void) { }

17 Coding: Algorithm Steps 1 //... void main(void) { cout << “\n Rectangular Area Calculator!!”; }

18 Coding: Algorithm Steps 2 //... void main(void) { cout << “\n Rectangular Area Calculator!”; carpet carpet_1; }

19 Coding: Algorithm Step 3 //... void main(void) { cout << “\n Rectangular Area Calculator!”; carpet carpet_1; int area = carpet_1.cal_area(); }

20 Coding: Algorithm Step 4 //... void main(void) { cout << “\n Rectangular Area Calculator!”; carpet carpet_1; int area = carpet_1.cal_area(); cout << "\n The area is " << area << ” square meter. \n\n"; }

21 Testing Run your program using sample data (whose correctness is easy to check): Rectangular Area Calculator! Enter the length (meter) and width (meter) separated by a space and followed by the enter key: The area is 200 square meter

22 Summary of OOD OOD is a methodology for designing programs: 1. Describe the desired behavior of the program. 2. Identify the objects required. 3. Identify the operations required. 4. Organize objects and operations into an algorithm, refining object and operation lists as necessary.

23 Summary of OOP Programming Writing a program consists of these steps: 1. Design an algorithm for your program. 2. Code your design. 3. Test your program. 4. Maintain/upgrade your program as necessary.