Professional Documents
Culture Documents
AN INTRODUCTION TO
COMPUTERS AND
PROBLEM SOLVING
07/31/21 Lecture 1
An Introduction to Computers and Problem
Solving
2
07/31/21
Communicating with the Computer
3
07/31/21
Compiler
4
07/31/21
Programming and Complicated Tasks
5
07/31/21
All Programs Have in Common:
6
07/31/21
Hardware and Software
7
07/31/21
Programmer and User
8
07/31/21
1.3 Program Development Cycle
9
07/31/21
Terminology
10
07/31/21
Program Development Cycle
11
07/31/21
Performing a Task on the
12
Computer
Determine Output
Identify Input
Determine process necessary to turn given Input into
desired Output
07/31/21
Problem-Solving: Approach Like
13
Algebra Problem
Example: Addition
Output: a number giving the result of addition.
Input: numbers you need to add.
Process: Result = num1 + num2.
07/31/21
Pictorial representation of the Problem
14
Solving Process
07/31/21
Program Planning
15
07/31/21
Program Planning (continued)
16
07/31/21
Program Development Cycle
17
07/31/21
Program Development Cycle
(continued)
18
07/31/21
1.4 Programming Tools
19
Flowcharts
Pseudocode
Hierarchy Chart
Direction of Numbered NYC Streets Algorithm
Class Average Algorithm
07/31/21
Algorithm
20
07/31/21
Programming Tools
21
carry out a task and shows how the steps relate to each
other.
Pseudocode - Uses English-like phrases with some
07/31/21
Problem Solving Example
22
07/31/21
Algorithm
23
07/31/21
Flowchart
24
07/31/21
Flowchart Symbols
25
07/31/21
Flowchart Symbols (continued)
26
07/31/21
Flowchart
27
Example
start
Distance
time
Speed=
Distance/time
Speed
End
07/31/21
Pseudocode
28
07/31/21
Pseudocode Example
29
07/31/21
Hierarchy Chart
30
top-down charts
07/31/21
Divide-and-Conquer Method
31
07/31/21
Statement Structures
32
Sequence – execute instructions from one line to
the next without skipping over any lines
Decision - if the answer to a question is “Yes” then
one group of instructions is executed. If the answer
is “No,” then another is executed
Looping – a series of instructions are executed
repeatedly
07/31/21
Sequence
33
Flow Chart
07/31/21
34 Decision Flow Chart
07/31/21
Looping
35
Flow Chart
07/31/21
Direction of Numbered NYC Streets
36
Algorithm
Problem: Given a street number of a one-way
street in New York City, decide the direction of the
street, either eastbound or westbound
Discussion: in New York City even numbered
streets are Eastbound, odd numbered streets are
Westbound
07/31/21
Flowchart
37
07/31/21
Pseudocode
38
07/31/21
Class Average Algorithm
40
07/31/21
Flowchart
41
07/31/21
Pseudocode
42
07/31/21
Comments
44
07/31/21
Tips and Tricks of Flowcharts
45
07/31/21