Académique Documents
Professionnel Documents
Culture Documents
The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning of each presentation. You may customize the presentations to fit your class needs. Some figures from the chapters are included. A complete set of images from the book can be found on the Instructor Resources disc.
Objectives
In this chapter, you will learn about: Computer components and operations Simple program logic The evolution of programming techniques The steps involved in the programming process Pseudocode and flowcharts Program comments Programming and user environments
Software
Programs (sets of instructions) written by programmers Application software: applied to a task (word processing, spreadsheets, payroll, etc.) System software: manages computer resources
Input operation
A means for data to enter computer through an input device
Mouse Keyboard
Computer memory
Temporary, internal storage (RAM)
Interpreters
Each instruction is translated just prior to execution Scripting languages such as Python, Lua, Perl, and PHP use interpreters
10
Instructions are independent of type of input device, computer hardware, and output device
12
13
14
Object-oriented programming
Focuses on objects Objects have attributes, behaviors, and states
Attributes: object feature Behaviors: what object does States: set of all values of attributes
16
Programmer may do all tasks or use systems analysts and/or software testers
17
White box
Tester looks at code, tests all logical paths
18
19
Data modeling
Identifying objects and their relationships
Data entity types (categories) Data attributes (characteristics of entities) Relationships
20
Examples of attributes
Stock number, description, price
Examples of relationships
Has a, is a, creates a
21
22
23
24
25
Compilers or interpreters
Translate English-like high-level programming into low-level machine language
26
27
28
29
Conversion
Actions an organization must take to switch to new system Can take months or years to accomplish
An Object-Oriented Approach to Programming Logic and Design 30
Why necessary
Fixing errors: e.g., handling numbers over a certain value Updating values: e.g., new tax rate Format of input data changes: e.g., zip+4 Input data may no longer be available User wants additional functionality
31
Flowchart
Pictorial representation of logical program steps
32
Writing Pseudocode
Example
start input myNumber myAnswer = myNumber * 2 output myAnswer stop
Starting and ending statements usually used Punctuation, syntax, and capitalization are unimportant in pseudocode
33
Drawing Flowcharts
Flowchart
Helps programmer visualize how statements connect Uses geometric shapes connected with arrows (flowlines)
Figure 1-3 Flowchart and pseudocode of program that doubles a number if it is less than 10
An Object-Oriented Approach to Programming Logic and Design 35
36
37
38
39
40
Summary
Hardware and software accomplish three major operations: input, processing, and output For a program to work properly, you must develop correct logic Logical errors are more difficult to locate than syntax errors Developing a system involves analyzing the system, designing it, and writing the programs Writing programs involves planning the logic, coding the program, translating into machine language, and testing
An Object-Oriented Approach to Programming Logic and Design 42
Summary (contd.)
Flowcharts and pseudocode are tools for planning a programs logic Program comments are nonexecuting statements for documentation purposes Plain text editor or integrated development environment (IDE) can be used to type a program A programs data input can be at a command line or a graphical user interface (GUI)
43