Dee7f8 Ch11 DM RM DM
Dee7f8 Ch11 DM RM DM
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All
Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Overview
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Approaches to Program Design and Development
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Examples of Structured Programming Modules
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Object-Oriented Programming (OOP)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of a Class Diagram
FIGURE 11-2: Button class. This class diagram illustrates that each object (instance) in the
Button class has four attributes to hold data about the current state of the button and three
methods to perform actions when messages are received.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Aspect-Oriented Programming and Adaptive/Agile
Software Development
• Aspect-oriented programming (AOP) separates functions so program
components can be developed and modified individually from one another
• The components can be easily reused
• Adaptive software development adapts programs as they are being written
• Typically iterative and/or incremental development
• Agile software development (ASD) can create software quickly
• Focuses on building small functional program pieces as the project progresses
• Emphasizes teams of people working closely together (programmers, managers,
business experts, customers, and so forth)
• Some mobile developers are using continuous mobile innovation
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The Program Development Life Cycle (P DLC)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The Program Development Life Cycle Illustrated
FIGURE 11-3: The program development life cycle (P DLC). Each phase of the program
development life cycle produces some type of documentation to pass on to the next phase.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Problem Analysis
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Design
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Design Tools: Structure Charts and
Flowcharts
• Structure charts (hierarchy charts) FIGURE 11-4: A flowchart example.
depict the overall organization of a
program
• Shows program modules and
hierarchy
• Flowcharts show the step-by-step
logic for a program, module, or
method
• Use special symbols and relational
operators
• Can be drawn by hand or with
flowcharting software
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Design Tools: Wireframes
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Design Tools: Unified Modeling
Language (UML)
• Unified Modeling Language (UML) FIGURE 11-7: Class diagrams. This example
is a set of standard notations for shows one class and two instances of that class.
creating business models
• Widely used in object-oriented
programs
• Includes class diagrams and use
case diagrams
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Control Structures (1 of 2)
• A control structure illustrates when, how, and in what order the statements in
a computer program, module, or method are performed
• Sequence control structure
• Series of statements that follow one another
• Selection control structure
• Multiple paths, direction depends on the result of a certain condition
• If-then-else (two possibilities)
• Case control structure (more than two possibilities)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Control Structures (2 of 2)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Examples of Control Structures
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Good Program Design
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of Writing Instructions for a Computer
versus a Person
FIGURE 11-9: Writing instructions for a computer versus a person. A
computer requires step-by-step instructions.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Design Testing
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of Desk Checking a Flowchart
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Coding
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Coding Process and Standards
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Examples of Program Comments
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Reusable Code
• Reusable code is pretested, error-free code segments that can be used over
and over again with minor modifications
• Can greatly reduce development time
• Class libraries
• Documentation: Documented source code
• Completed source code in the desired language that implements the logic
illustrated by the program design specifications
• Should include enough comments (internal documentation) so that the source
code is easy to understand and update
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Technology and You
Programming Contests
• One example is the TopCoder
Open
• Six competitions
• Initial qualifying rounds are online
• 12 semifinalists compete on site
• $300,000 in prizes
• Other competitions are available
online
Source: TopCoder
TopCoder Open competitors.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Debugging and Testing
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Compilers, Interpreters, and Assemblers
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Preliminary Debugging
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of a Syntax Error
FIGURE 11-13: Syntax errors. Occur when the syntax (grammar rules) for a program is
not followed precisely; they become obvious when compiling a program.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of a Logic Error and Dummy Print
Statements
FIGURE 11-14: Logic errors. Are more difficult to identify; dummy print statements can
help determine the error.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Testing
• Testing occurs after the preliminary debugging process to find any additional
errors
• Use good test data—data that is very similar to the actual data that will be used
in the finished program
• Test to see how the program handles nonstandard situations or possible input
errors
• Alpha tests are on site
• Beta tests are outside tests
• Documentation: Completed program package
• Test data, test results, finished program code, and other documentation
• User documentation (users’ manual, etc.)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Program Implementation and Maintenance
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Quick Quiz 1
Answers:
1) b; 2) True; 3) pseudocode
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Tools for Facilitating Program Development
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of Issue Tracking Software
Source: Atlassian
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Application Generators and Device Development
Tools
• Application generators are software program that helps programmers
develop software
• Macro: A sequence of saved actions that can be replayed when needed
• Written in a macro programming language such as Visual Basic for Applications or
recorded
• Report generator: A tool that prepares reports to be used with a software
program quickly and easily
• User interface (UI) builder: Creates the menus, forms, and input screens used
with a program or database
• Device development tools assist with developing embedded software to be
used on devices, such as cars, ATM machines, and consumer devices
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Examples of User Interface (UI ) Builders
FIGURE 11-16: User interface (UI) builders.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Quick Quiz 2
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Trend
Mobile UX
• UX (user experience) guidelines:
• Determine the primary objectives of
the application and your targeted
audience
• Keep the design simple, clean,
efficient, and task-oriented
• Make the application fast and
responsive
• Don’t require sign-in if not necessary
• Be aware of emerging trends Source: hats.com
It is important to create a good user
experience (UX).
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Low-Level Programming Languages
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of Machine and Assembly Language
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
High-Level Programming Languages
Source: Scratch is a project of the Lifelong Kindergarten Group at the M IT Media Lab
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Fourth-Generation Languages (4GLs)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Common Programming Languages: Fortran
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
A Sample Fortran Program
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
COBOL
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
A Sample COBOL Program
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Pascal, BASIC, and Visual Basic
• Pascal
• Named after mathematician Blaise Pascal
• Created as a teaching tool to encourage structured programming
• Contains a variety of control structures used to manipulate modules
systematically
• BASIC (Beginner’s All-purpose Symbolic Instruction Code)
• Easy-to-learn, high-level programming language that was developed to be used
by beginning programmers
• Used for interactive programs
• Visual Basic: Version of BASIC that uses a visual environment
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
C, C++, C#, Objective-C, Swift, and F#
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
A Sample C++ Program
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Java and Dart
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
A Sample Java Program
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
A Sample Dart Program
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Python
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
A Sample Python Program
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
How It Works
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Markup Languages: HTML
• Define the structure, layout, and general appearance of the content located
on a Web page
• Hypertext Markup Language (HTML): The markup language designed for
creating Web pages
• Use HTML tags - Text-based codes embedded into a Web page’s source code
• Indicate the location and appearance of content on that Web page
• Some are paired tags
• The Web browser, browser settings, and device used ultimately determine what
the Web page will look like
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Examples of HTML Tags (1 of 2)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Examples of HTML Tags (2 of 2)
TAG PURPOSE
<a></a> Defines a hyperlink using the specified URL; can include an
image file name, hyperlink text, and other attributes.
<b></b> Bolds text.
<!-- --> Indicates a comment that won’t display when the Web page is
viewed.
<hr> Inserts a horizontal rule.
<p> Inserts a paragraph break (starts a new paragraph).
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
XML and XHTML
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
HT M L 5
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of an HTML5 Web page
FIGURE 11-27: An example of HTML5 source code and its corresponding web page.
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Scripting Languages
• Scripting languages
• Add dynamic content to a Web page
• Scripts are embedded into a Web page’s code
• Scripts are used as middleware to tie a Web site to a database
• Scripts can be run:
• By the Web browser being used to view the Web page (client-side script)
• By the Web server hosting the Web page being viewed (server-side script)
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Examples of Scripting Languages
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Example of JavaScript
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Quick Quiz 3
Answers:
1) a; 2) False; 3) HTML5
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Summary
Deborah Morley/Charles S. Parker, Understanding Computers: Today and Tomorrow, Comprehensive, 16th Edition. © 2017 Cengage. All Rights
Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.