Title: Programming and Problem Solving
1Programming and Problem Solving
- Jianhua Yang
- Department of Computer Science
- University of Houston
2Goals
- What is a computer program?
- How to write a program?
- What is an algorithm?
- What is a high-level programming language?
- What is a compiler?
- What is a computer?
- Hardware and software
- Problem-solving method
31.1 Overview of Programming
- 1. The concept of programming
- Programming
- Computer
- Computer programming
- Computer program
-
Planning or scheduling the performance of a task
or an event
A programmable device that can store, retrieve,
and process data
The process of planning a sequence of steps for a
computer to follow
A sequence of instructions to be performed by a
computer
41.1 Overview of Programming
- 2. How to write a program?
- Problem-solving phase
- Implementation phase
- Maintenance phase
- Analysis
- Algorithm
- Verification
51.1 Overview of Programming
- Algorithm
- A step-by-step procedure for solving a problem in
a finite amount of time.
- Insert the key
- Make sure the transmission in Park
- Depress the gas pedal
- Turn the key to the start position
- If the engine starts, release the key
- if it does not, repeat to start
- Or call the mechanic
61.1 Overview of Programming
- Programs life cycle
- Problem-solving
- Implementation
- Maintenance
71.1 Overview of Programming
- Programming language
- Documentation
- Information
- Data
A set of rules, symbols, and special words used
to construct a computer program
The written text and comments that make a program
easier for others to understand, use and modify
Any knowledge that can be communicated
Computerized information
81.1 Overview of Programming
Algorithm
Problem
Program
91.2 Programming Language
is a language can be used to write a program
which is recognized by a computer
Including machine language, and high-level
language
101.2 Programming Language
- Compiler
- Source program
- Object program
- Compilation
- Execution
111.2 Programming Language
- 2. the structure of PL
- Sequence
- Selection
- loop
121.2 Programming Language
Statement
Statement
Statement
131.2 Programming Language
Statement
Condition
Statement
141.2 Programming Language
Condition
151.2 Programming Language
is a program can be executed independently
Statement1 Statement2 Call subprogram Loop Selecti
on Statement3
161.2 Programming Language
- Example
- Compute the sum of 1!2!3!n!
sum0 s1compute(1!) sumsums1 s2compute(2!)
sumsums2 . sumsumsn
sum0 k1 loop (k ! n1) sumsumcp(k)
kk1
171.3 What is a computer
- Computer
- Software
- Hardware
System software Developing software
Application software
Central Processing Unit (CPU) Memory Unit
Input/Output Unit Auxiliary Storage Device
181.3 What is a computer
Input device
Output device
Central Processing Unit
Control Unit
Computing Unit
Auxiliary Storage device
Memory Unit
191.4 Ethics and Responsibilities in the Computing
Profession
- Software piracy
- Privacy of data
- Use of computer resources
- Software engineering
The unauthorized copying of software
201.5 Problem-Solving Techniques