SlideShare a Scribd company logo
Object Oriented
Programming
Objects and Classes
Dr. Khalil Ullah
Department of Software Engineering
khalil.ullah@uom.edu.pk
University of Malkand
Bridging the gap between inspiration and aspiration 1
Class
Object
2
Welcome

Object-Oriented Programming
 Mon. Tue. Wed., 9:00–10:00 a.m.
 Instructor: Dr. Khalil Ullah
 Email – Khalil.ullah@uom.edu.pk
 Office hours – Thu. and Fri. 9:30–11:00 am.
 Contact No. 03480916815.
3
Required Textbook
H. M. Deitel and P. J. Deitel, C++ How to Program,
Fifth Edition. Upper Saddle River, NJ: Prentice Hall,
2005. ISBN 0-13-185757-6
Textbook web page:
http://www.deitel.com/books/cppHTP5/index.html
A recommended book (not required):
Ann R. Ford and Toby J. Teorey, Practical Debugging in
C++. Upper Saddle River, NJ: Prentice Hall, 2002.
ISBN 0-13-065394-2
Object Oriented Programming by Robert Lafore
Course Introduction
4
How to Succeed
 Read the chapter before class
 Participate
 In class and in the discussions
 Learn object-oriented programming by
writing a lot of small programs
 To learn C++ programming skills
 To apply those skills in problem solving
 Start the assignments early
 Invest time and work hard!
Course Introduction
5
C++ AND
OBJECT-ORIENTED PROGRAMMING
Some brief facts
6
Historical Perspective
 1968 – The “software crisis”
 NATO Software Engineering Conference in Garmisch,
Germany
 Late projects, high costs, code was hard to maintain
 Ad hoc programming
 Structured programming
 Adapted in the late 1960s to produce programs that
were easy to understand, develop, test, and modify
C++ and Object-Oriented Programming (Deitel; Randell; Wirth)
7
Structured Programming
 Programs should be composed of pieces
that have only one starting point and one
terminating point
 Use only three kinds of “pieces”
1. Sequence
2. Selection control structures
 e.g., if, if/else, switch
3. Repetition control structures
 e.g., while, do/while, for
C++ and Object-Oriented Programming (Deitel; Wirth)
8
Object-Oriented Programming
 Became widely used in the 1990s
 Provided the foundation for real progress in creating software that
is easy to understand, develop, test, and modify
 A way of solving a problem by writing a program that
models the elements in the problem space as objects
 For example, a program used to support a video rental business
would have objects such as a store, videos, and customers
 Programs are collections of objects
 Each object can provide a set of services
 Objects interact by sending messages telling each other what to
do
C++ and Object-Oriented Programming (Deitel; Eckel)
9
Object-Oriented Programming
 Some advantages
 Easy to understand and develop because the objects directly
model real-world elements
 Faster development
 Easier to maintain
 Object-oriented software is easier to reuse
 Object-based programming
 Class – program element that contains both data and the
functions that manipulate it
 Object –instance of a class (like a “variable”)
 Object-oriented programming
 Inheritance
 Polymorphism
C++ and Object-Oriented Programming (Deitel)
10
Brief Facts About C++
 Evolved from C
 Designed and implemented by Bjarne Stroustrup at
the Bell Labs in the early 1980s
 “C with classes”
 Standardized by ISO in 1997
 Includes the C++ standard library
 Standard Template Library (STL)
 Part of the C++ standard library
 Readymade classes for data structures and algorithms
C++ and Object-Oriented Programming (Deitel; Josuttis)
11
INTRODUCTION TO
C++ PROGRAMMING
C++ Features in Chapter 1
12
A Simple Example
 Page 42, Fig. 2.4
 C++ features
 Comments
 Include directive
 main()
 Statements end with semicolons ;
 cout and << for output
 std namespace
 Escape characters, e.g. n
Introduction to C++ Programming (Deitel)
13
1 // Fig. 2.4: fig02_04.cpp
2 // A first program in C++.
3 #include <iostream>
4
5 // function main begins program execution
6 int main()
7 {
8 std::cout << "Welcome to C++!n";
9
10 return 0; // indicate that program ended successfully
11
12 } // end function main
Welcome to C++!
Single-line
comments.
Preprocessor directive to
include input/output stream
header file <iostream>.
Function main appears
exactly once in every C++
program..
Function main returns an
integer value.
Left brace { begins
function body.
Corresponding right
brace } ends function
body.
Statements end with a
semicolon ;.
Name cout belongs to
namespace std.
Stream insertion operator.
Keyword return is one of
several means to exit
function; value 0 indicates
program terminated
successfully.
14
Another Example
 Page 43, Fig. 2.5
 C++ features
 Declaring variables
 Input using cin and >>
 C++ supports many arithmetic operators
+, -, *, /, %
Precedence, p. 33: parentheses first; then *,/, and %;
and last are + and –. All from left to right.
 endl to output a newline and flush output buffer
 << can be concatenated
Introduction to C++ Programming (Deitel)
15
1 // Fig. 2.5: fig02_05.cpp
2 // Addition program.
3 #include <iostream>
4
5 // function main begins program execution
6 int main()
7 {
8 int integer1; // first number to be input by user
9 int integer2; // second number to be input by user
10 int sum; // variable in which sum will be stored
11
12 std::cout << "Enter first integern"; // prompt
13 std::cin >> integer1; // read an integer
14
15 std::cout << "Enter second integern"; // prompt
16 std::cin >> integer2; // read an integer
17
18 sum = integer1 + integer2; // assign result to sum
19
20 std::cout << "Sum is " << sum << std::endl; // print sum
21
22 return 0; // indicate that program ended successfully
23
24 } // end function main
Declare integer variables.
Use stream extraction
operator with standard
input stream to obtain user
input.
Stream manipulator
std::endl outputs a
newline, then “flushes
output buffer.”
Concatenating, chaining or
cascading stream insertion
operations.
Calculations can be performed in output statements:
alternative for lines 18 and 20:
std::cout << "Sum is " << integer1 + integer2 << std::endl;
16
Equality Operators and
Relational Operators
 Page 53, Fig. 2.13
 C++ features
 if
 equality operator == (don’t confuse with = )
 operator !=
 operator <
 operator >
 operator <=
 operator >=
Introduction to C++ Programming (Deitel)
What is Object Oriented Programming?
 OOP is a programming paradigm or
programming style centered around objects
rather than functions.
 This style of programming is not new but is
followed since 1970s.
 Object Oriented Programming is not a
programming language or a tool, but it is a
framework, a style, a way of doing programming
 There are many languages which support OOP
framework
17
Languages
 C++
 C#
 JAVA
 Ruby
 Python
 JavaScript
 And many more
18
 Many of the new frameworks that are
introduced recently in the market and are used
in web development like Object Oriented PHP
and Angular are designed using OOPs
programming concepts
 OOPs concepts are very Important for a serious
programmer who want to be a developer or a
successful software engineer in the market
19
Four main pillars of Object Oriented programming
20
Encapsulation
 Look first into the procedural programming
21
f() x,y
f() x,y,z
f() w,x,y,z
Program
Encapsulation
 This problem of interdependency of functions in
procedural programing is now solved in OOPs
22
f() x
f() x
Property
Method
23
Procedural programming example
 float wage(float bS,int ot,float rate)
 {
 return bS + ot*rate;
 }
 int main(int argc, char** argv) {

 float baseSalary=20000, rate=20;
 int overtime = 10;
 float netSalary;
 netSalary = wage(baseSalary,overtime,rate)
 return 0;
 } 24
Solve the same problem using OOP
 class employee
 {
 private:
 float baseSalary=10
 int overTime=20;
 float rate=30;
 public:
 float wage()
 {
 return (baseSalary + overTime*rate);
 }
 };
 int main(int argc, char** argv) {

 employee e1;
 cout<<e1.wage();
 return 0;
 } 25
Encapsulation
- process of binding data members
(variables, properties) and member
functions (methods) together.
- Providing different levels of scope on
how classes, methods, and attributes can
be accessed and only allowing access on
a need-to-know basis. Generally, oop
uses private, public and protected
keywords to implement encapsulation on
attributes, methods and classes. For
example, a private method in a class
could only be accessed by the class and
a public method could be accessed any
other class.
Abstraction
 Abstraction is the process of showing only
essential/necessary features of an entity/object
to the outside world and hide the other
irrelevant information.
26
Simpler Interface
Reduce the
impact of change
Inheritance
 The mechanism which allows you to eliminate
the redundant code
 Consider these HTML elements
27
HTML Element
Size
Color
Click()
Focus()
Polymorphism
 Poly means Many and Morph means form
 It is a technique which allows you to get rid of
long if else switch case statements.
 For example rendring HTML
element
28
HTML Element
Size
Color
Click()
Focus()
In Procedural
Language the code
for rendering these
elements will be:
switch(…){
Case ‘select’:
renderSelect();
Case ‘text’:
renderTextBox()
…
…
}
 In OOP
We implement
Render method
For each object and it
Will behave differently
For each object;
Virtual render(){}
In main it can be called like: textbox.render();
select.render(); 29
HTML Element
Size
Color
Click()
Focus()
30
 We begin our introduction to object orientation,
a natural way of thinking about the world and
writing computer programs.
 Our goal here is to help you develop an object-
oriented way of thinking and to introduce you to
the Unified Modeling Language™ (UML™)a
graphical language that allows people who
design object-oriented software systems to use
an industry-standard notation to represent
them.
31
 analyze a typical requirements document that
describes a software system (the ATM) to be
built
 determine the objects required to implement
that system
 determine the attributes the objects will have
 determine the behaviors these objects will
exhibit
 specify how the objects interact with one
another to meet the system requirements
32
 Let's begin with a simple analogy to help you reinforce your understanding of
classes and their contents.
 Suppose you want to drive a car and make it go faster by pressing down on its
accelerator pedal.
 What must happen before you can do this?
 Well, before you can drive a car, someone has to design it and build it.
 A car typically begins as engineering drawings, similar to the blueprints used to
design a house.
 These drawings include the design for an accelerator pedal that the driver will
use to make the car go faster.
 In a sense, the pedal "hides" the complex mechanisms that actually make the
car go faster, just as the brake pedal "hides" the mechanisms that slow the car,
the steering wheel "hides" the mechanisms that turn the car and so on.
 This enables people with little or no knowledge of how cars are engineered to
drive a car easily, simply by using the accelerator pedal, the brake pedal, the
steering wheel, the transmission shifting mechanism and other such simple
and user-friendly "interfaces" to the car's complex internal mechanisms. 33

More Related Content

PDF
C++
PPTX
Object oriented programming 7 first steps in oop using c++
PDF
Object Oriented Programming With C 2140705 Darshan All Unit Darshan Institute...
PPTX
Object oriented programming. (1).pptx
PDF
M.c.a (sem iii) paper - i - object oriented programming
PPT
the education purpose of software C++.ppt
PPTX
object oriented programming language in c++
PDF
Object Oriented Programming With C Sharma A K
C++
Object oriented programming 7 first steps in oop using c++
Object Oriented Programming With C 2140705 Darshan All Unit Darshan Institute...
Object oriented programming. (1).pptx
M.c.a (sem iii) paper - i - object oriented programming
the education purpose of software C++.ppt
object oriented programming language in c++
Object Oriented Programming With C Sharma A K

Similar to Object Oriented Programming beigneers Lecture 01 (1).pptx (20)

PDF
CS305PC_C++_UNIT 1 notes jntuh third semester
PPT
PPTX
CSC2161Programming_in_Cpp_Lecture4-OOP Classes and Objects[1].pptx
PDF
C++ [ principles of object oriented programming ]
PPTX
An introduction to object-oriented programming.pptx
PPT
C++ basic intro on c++ programming language ppt
PPSX
SRAVANByCPP
PPTX
OODP Unit 1 OOPs classes and objects
PDF
1 puc programming using c++
PPT
The smartpath information systems c plus plus
PPTX
C++ & Data Structure - Unit - first.pptx
PDF
OOPS_Unit_1
PPTX
The Big Picture
PPTX
Object oriented programming 2 elements of programming
PPT
Object Oriented Technologies
PPTX
Lecture 1.pptx
PPTX
Programming in c++
PPTX
Programming in c++
PPTX
Procedure Oriented programming Object Oriented programming Basic Concept of ...
CS305PC_C++_UNIT 1 notes jntuh third semester
CSC2161Programming_in_Cpp_Lecture4-OOP Classes and Objects[1].pptx
C++ [ principles of object oriented programming ]
An introduction to object-oriented programming.pptx
C++ basic intro on c++ programming language ppt
SRAVANByCPP
OODP Unit 1 OOPs classes and objects
1 puc programming using c++
The smartpath information systems c plus plus
C++ & Data Structure - Unit - first.pptx
OOPS_Unit_1
The Big Picture
Object oriented programming 2 elements of programming
Object Oriented Technologies
Lecture 1.pptx
Programming in c++
Programming in c++
Procedure Oriented programming Object Oriented programming Basic Concept of ...
Ad

Recently uploaded (20)

PDF
Pre independence Education in Inndia.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PDF
Insiders guide to clinical Medicine.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
From loneliness to social connection charting
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
PPTX
Onica Farming 24rsclub profitable farm business
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
Pre independence Education in Inndia.pdf
Anesthesia in Laparoscopic Surgery in India
How to Manage Starshipit in Odoo 18 - Odoo Slides
Insiders guide to clinical Medicine.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
From loneliness to social connection charting
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Revamp in MTO Odoo 18 Inventory - Odoo Slides
Onica Farming 24rsclub profitable farm business
STATICS OF THE RIGID BODIES Hibbelers.pdf
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
102 student loan defaulters named and shamed – Is someone you know on the list?
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Ad

Object Oriented Programming beigneers Lecture 01 (1).pptx

  • 1. Object Oriented Programming Objects and Classes Dr. Khalil Ullah Department of Software Engineering [email protected] University of Malkand Bridging the gap between inspiration and aspiration 1 Class Object
  • 2. 2 Welcome  Object-Oriented Programming  Mon. Tue. Wed., 9:00–10:00 a.m.  Instructor: Dr. Khalil Ullah  Email – [email protected]  Office hours – Thu. and Fri. 9:30–11:00 am.  Contact No. 03480916815.
  • 3. 3 Required Textbook H. M. Deitel and P. J. Deitel, C++ How to Program, Fifth Edition. Upper Saddle River, NJ: Prentice Hall, 2005. ISBN 0-13-185757-6 Textbook web page: http://www.deitel.com/books/cppHTP5/index.html A recommended book (not required): Ann R. Ford and Toby J. Teorey, Practical Debugging in C++. Upper Saddle River, NJ: Prentice Hall, 2002. ISBN 0-13-065394-2 Object Oriented Programming by Robert Lafore Course Introduction
  • 4. 4 How to Succeed  Read the chapter before class  Participate  In class and in the discussions  Learn object-oriented programming by writing a lot of small programs  To learn C++ programming skills  To apply those skills in problem solving  Start the assignments early  Invest time and work hard! Course Introduction
  • 6. 6 Historical Perspective  1968 – The “software crisis”  NATO Software Engineering Conference in Garmisch, Germany  Late projects, high costs, code was hard to maintain  Ad hoc programming  Structured programming  Adapted in the late 1960s to produce programs that were easy to understand, develop, test, and modify C++ and Object-Oriented Programming (Deitel; Randell; Wirth)
  • 7. 7 Structured Programming  Programs should be composed of pieces that have only one starting point and one terminating point  Use only three kinds of “pieces” 1. Sequence 2. Selection control structures  e.g., if, if/else, switch 3. Repetition control structures  e.g., while, do/while, for C++ and Object-Oriented Programming (Deitel; Wirth)
  • 8. 8 Object-Oriented Programming  Became widely used in the 1990s  Provided the foundation for real progress in creating software that is easy to understand, develop, test, and modify  A way of solving a problem by writing a program that models the elements in the problem space as objects  For example, a program used to support a video rental business would have objects such as a store, videos, and customers  Programs are collections of objects  Each object can provide a set of services  Objects interact by sending messages telling each other what to do C++ and Object-Oriented Programming (Deitel; Eckel)
  • 9. 9 Object-Oriented Programming  Some advantages  Easy to understand and develop because the objects directly model real-world elements  Faster development  Easier to maintain  Object-oriented software is easier to reuse  Object-based programming  Class – program element that contains both data and the functions that manipulate it  Object –instance of a class (like a “variable”)  Object-oriented programming  Inheritance  Polymorphism C++ and Object-Oriented Programming (Deitel)
  • 10. 10 Brief Facts About C++  Evolved from C  Designed and implemented by Bjarne Stroustrup at the Bell Labs in the early 1980s  “C with classes”  Standardized by ISO in 1997  Includes the C++ standard library  Standard Template Library (STL)  Part of the C++ standard library  Readymade classes for data structures and algorithms C++ and Object-Oriented Programming (Deitel; Josuttis)
  • 11. 11 INTRODUCTION TO C++ PROGRAMMING C++ Features in Chapter 1
  • 12. 12 A Simple Example  Page 42, Fig. 2.4  C++ features  Comments  Include directive  main()  Statements end with semicolons ;  cout and << for output  std namespace  Escape characters, e.g. n Introduction to C++ Programming (Deitel)
  • 13. 13 1 // Fig. 2.4: fig02_04.cpp 2 // A first program in C++. 3 #include <iostream> 4 5 // function main begins program execution 6 int main() 7 { 8 std::cout << "Welcome to C++!n"; 9 10 return 0; // indicate that program ended successfully 11 12 } // end function main Welcome to C++! Single-line comments. Preprocessor directive to include input/output stream header file <iostream>. Function main appears exactly once in every C++ program.. Function main returns an integer value. Left brace { begins function body. Corresponding right brace } ends function body. Statements end with a semicolon ;. Name cout belongs to namespace std. Stream insertion operator. Keyword return is one of several means to exit function; value 0 indicates program terminated successfully.
  • 14. 14 Another Example  Page 43, Fig. 2.5  C++ features  Declaring variables  Input using cin and >>  C++ supports many arithmetic operators +, -, *, /, % Precedence, p. 33: parentheses first; then *,/, and %; and last are + and –. All from left to right.  endl to output a newline and flush output buffer  << can be concatenated Introduction to C++ Programming (Deitel)
  • 15. 15 1 // Fig. 2.5: fig02_05.cpp 2 // Addition program. 3 #include <iostream> 4 5 // function main begins program execution 6 int main() 7 { 8 int integer1; // first number to be input by user 9 int integer2; // second number to be input by user 10 int sum; // variable in which sum will be stored 11 12 std::cout << "Enter first integern"; // prompt 13 std::cin >> integer1; // read an integer 14 15 std::cout << "Enter second integern"; // prompt 16 std::cin >> integer2; // read an integer 17 18 sum = integer1 + integer2; // assign result to sum 19 20 std::cout << "Sum is " << sum << std::endl; // print sum 21 22 return 0; // indicate that program ended successfully 23 24 } // end function main Declare integer variables. Use stream extraction operator with standard input stream to obtain user input. Stream manipulator std::endl outputs a newline, then “flushes output buffer.” Concatenating, chaining or cascading stream insertion operations. Calculations can be performed in output statements: alternative for lines 18 and 20: std::cout << "Sum is " << integer1 + integer2 << std::endl;
  • 16. 16 Equality Operators and Relational Operators  Page 53, Fig. 2.13  C++ features  if  equality operator == (don’t confuse with = )  operator !=  operator <  operator >  operator <=  operator >= Introduction to C++ Programming (Deitel)
  • 17. What is Object Oriented Programming?  OOP is a programming paradigm or programming style centered around objects rather than functions.  This style of programming is not new but is followed since 1970s.  Object Oriented Programming is not a programming language or a tool, but it is a framework, a style, a way of doing programming  There are many languages which support OOP framework 17
  • 18. Languages  C++  C#  JAVA  Ruby  Python  JavaScript  And many more 18
  • 19.  Many of the new frameworks that are introduced recently in the market and are used in web development like Object Oriented PHP and Angular are designed using OOPs programming concepts  OOPs concepts are very Important for a serious programmer who want to be a developer or a successful software engineer in the market 19
  • 20. Four main pillars of Object Oriented programming 20
  • 21. Encapsulation  Look first into the procedural programming 21 f() x,y f() x,y,z f() w,x,y,z Program
  • 22. Encapsulation  This problem of interdependency of functions in procedural programing is now solved in OOPs 22 f() x f() x Property Method
  • 23. 23
  • 24. Procedural programming example  float wage(float bS,int ot,float rate)  {  return bS + ot*rate;  }  int main(int argc, char** argv) {   float baseSalary=20000, rate=20;  int overtime = 10;  float netSalary;  netSalary = wage(baseSalary,overtime,rate)  return 0;  } 24
  • 25. Solve the same problem using OOP  class employee  {  private:  float baseSalary=10  int overTime=20;  float rate=30;  public:  float wage()  {  return (baseSalary + overTime*rate);  }  };  int main(int argc, char** argv) {   employee e1;  cout<<e1.wage();  return 0;  } 25 Encapsulation - process of binding data members (variables, properties) and member functions (methods) together. - Providing different levels of scope on how classes, methods, and attributes can be accessed and only allowing access on a need-to-know basis. Generally, oop uses private, public and protected keywords to implement encapsulation on attributes, methods and classes. For example, a private method in a class could only be accessed by the class and a public method could be accessed any other class.
  • 26. Abstraction  Abstraction is the process of showing only essential/necessary features of an entity/object to the outside world and hide the other irrelevant information. 26 Simpler Interface Reduce the impact of change
  • 27. Inheritance  The mechanism which allows you to eliminate the redundant code  Consider these HTML elements 27 HTML Element Size Color Click() Focus()
  • 28. Polymorphism  Poly means Many and Morph means form  It is a technique which allows you to get rid of long if else switch case statements.  For example rendring HTML element 28 HTML Element Size Color Click() Focus() In Procedural Language the code for rendering these elements will be: switch(…){ Case ‘select’: renderSelect(); Case ‘text’: renderTextBox() … … }
  • 29.  In OOP We implement Render method For each object and it Will behave differently For each object; Virtual render(){} In main it can be called like: textbox.render(); select.render(); 29 HTML Element Size Color Click() Focus()
  • 30. 30
  • 31.  We begin our introduction to object orientation, a natural way of thinking about the world and writing computer programs.  Our goal here is to help you develop an object- oriented way of thinking and to introduce you to the Unified Modeling Language™ (UML™)a graphical language that allows people who design object-oriented software systems to use an industry-standard notation to represent them. 31
  • 32.  analyze a typical requirements document that describes a software system (the ATM) to be built  determine the objects required to implement that system  determine the attributes the objects will have  determine the behaviors these objects will exhibit  specify how the objects interact with one another to meet the system requirements 32
  • 33.  Let's begin with a simple analogy to help you reinforce your understanding of classes and their contents.  Suppose you want to drive a car and make it go faster by pressing down on its accelerator pedal.  What must happen before you can do this?  Well, before you can drive a car, someone has to design it and build it.  A car typically begins as engineering drawings, similar to the blueprints used to design a house.  These drawings include the design for an accelerator pedal that the driver will use to make the car go faster.  In a sense, the pedal "hides" the complex mechanisms that actually make the car go faster, just as the brake pedal "hides" the mechanisms that slow the car, the steering wheel "hides" the mechanisms that turn the car and so on.  This enables people with little or no knowledge of how cars are engineered to drive a car easily, simply by using the accelerator pedal, the brake pedal, the steering wheel, the transmission shifting mechanism and other such simple and user-friendly "interfaces" to the car's complex internal mechanisms. 33