28
College of Computer and Information Science Chapter 14 Programming and Languages

College of Computer and Information Science Chapter 14 Programming and Languages

Embed Size (px)

Citation preview

College of Computer and Information Science

Chapter 14

Programming and Languages

College of Computer and Information Science 14-2

Key Words & Terms• application generator: 代码生成器• assembly language: 汇编语言• beta testing: beta 测试• code: 代码• coding: 编码• compiler: 编译器• computer-aided software engineering (CASE) tools: 计算机辅助

软件工程工具• debugging: 调试 • desk checking: 桌面检测• DO UNTIL structure: 一种循环结构 DO UNTIL• DO WHILE structure: 一种循环结构 DO WHILE• documentation: 文档化• fifth-generation language (5GL): 第五代语言• formatting language: 格式化语言• fourth-generation language (4GL): 第四代语言 • generation: 代,级• higher level: 高级

College of Computer and Information Science 14-3

Key Words & Terms• IF-THEN-ELSE structure: 分支结构• IFPS (interactive financial planning system): 交互式财务策划系统• interpreter: 解释器• levels: 层次,级• logic error: 逻辑错• logic structure: 逻辑结构• loop structure: 循环结构• lower level: 低级• machine language: 机器语言 • maintenance programmer: 维护程序员• markup language: 标记语言• module: 模块• natural language: 自然语言• object: 对象• object code: 对象代码 • object-oriented programming (OOP): 面向对象程序设计 • object-oriented software development: 面向对象软件开发• objectives: 目标,对象

College of Computer and Information Science 14-4

Key Words & Terms• operators: 操作员• portable language: 可移植语言 • problem-oriented language: 面向问题语言• procedural language: 过程语言• program: 程序• program analysis: 程序分析 • program coder: 代码生成器• program definition: 程序定义 • program design: 程序设计 • program documentation: 程序文档• program flowchart: 程序流程图• program maintenance: 程序维护• program modules: 程序模块• program specification: 程序说明• programmer: 程序员 • programming: 编程,程序设计• programming language: 程序设计语言• pseudo-code: 伪码

College of Computer and Information Science 14-5

Key Words & Terms• query language: 查询语言 • selection structure: 选择结构 • sequence structure: 顺序结构• software development: 软件开发• software engineer: 软件工程• source code: 源代码 • structured program: 结构化程序• structured programming techniques: 结构化程序设计技术 • syntax error: 语法错• third generation language (3GL) : 第三代语言• top-down program design: 自上而下程序设计• user: 用户 • very high level language: 超高级语言 • visual programming language: 可视化程序设计语言

College of Computer and Information Science 14-6

Competencies (Page 1 of 2)

• Describe the six steps of programming

• Discuss design tools including top-down design, pseudocode, flowcharts, and logic structures

• Describe program testing and the tools for finding and removing errors

Page 4398

College of Computer and Information Science 14-7

Competencies (Page 2 of 2)

• Describe CASE tools and object-oriented software development

• Explain the five generations of programming languages

Page 398

College of Computer and Information Science 14-8

Introduction

• In this chapter programming is described in two parts: (1) the steps in the programming process and (2) some of the programming languages available.

• Programming is part of Phase 4, systems development, in the systems life cycle.

• Competent end users need to understand the relationship between systems development and programming.

Page 399

College of Computer and Information Science 14-9

Programs and Programming

• What is a Program? • A problem-solving procedure

– A list of instructions• Prewritten• Custom-written • Application software• System software

Page 400

College of Computer and Information Science 14-10

What is Programming?

• Programming is software development• Six step procedure

– Program specification– Program design– Program code– Program test– Program documentation– Program maintenance

Page 400

College of Computer and Information Science 14-11

Step 1: Program Specification

Page 401

• Also called programs definition or program analysis

• 5 Step Process– Program Objectives– Desired Output– Input Data– Processing Requirements– Document Program Specifications

College of Computer and Information Science 14-12

Program Objectives

• Objectives are the problems that you are trying to solve

• Programming requires a clear statement of the problem that you are looking to address

ReturnPage 401

College of Computer and Information Science 14-13

Program Specification Steps Continued

Page 402

• Desired output• Input Data• Processing

Requirements• Program

Specifications Document

Example of statement of hours worked

End user’s sketch of desired output

College of Computer and Information Science 14-14

Step 2: Program Design

• Plan a solution• Use structured programming techniques

– Top-down program design– Pseudocode– Flowcharts– Logic structures

Page 403

College of Computer and Information Science 14-19

Step 3: Program Code

• Writing the program or coding • The good program

– Reliable– Catch input errors – Understandable to other

programmers– Structured programs best method– Use the most appropriate

computer language

• Coding

Page 407

College of Computer and Information Science 14-20

Coding

• Formatting or presentation language

• Programming language

Page 408

College of Computer and Information Science 14-21

Step 4: Program Test

• Debugging– Testing – Eliminating errors

• Syntax errors• Logic errors• Testing process

Page 422

College of Computer and Information Science 14-22

Step 5: Program Documentation

• Written descriptions and procedures about a program

• Important for people who will use the program– Users– Operators – Programmers

Page 411

College of Computer and Information Science 14-23

Step 6: Program Maintenance

• 75% of total lifetime cost• Error-free operations • Effective program• Two categories

– Operations– Changing needs

Page 412

College of Computer and Information Science 14-24

Case Tools

• Computer-aided software engineering (CASE)– Automate development process

• Designing• Coding• Testing activities

Page 414

College of Computer and Information Science 14-25

Object-Oriented Software Development

• Focuses less on procedures, more on

relationship between objects

• OOP: Object-oriented programming

• Object contains both the data and the

processing operations

Page 415

College of Computer and Information Science 14-26

Generations of Programming Languages (Page 1 of 2)

• Occurring in “generations” or “levels”– Levels-Machine languages to natural languages

• There are five generations :– Lower level closer to machine language– Higher level closer to human-like language

Page 415

College of Computer and Information Science 14-27

• 1st -- Machine languages • 2nd -- Assembly languages• 3rd -- High level procedural languages (3GL)• 4th -- Problem-Oriented languages (4GL)• 5th -- Natural Languages & Visual

programming languages (5GL)

Page 415

Generations of Programming Languages (Page 2 of 2)

College of Computer and Information Science 14-28

Language Translators

• compiler

compiling linking

resource code========>.obj=======>.exe

• interpreter

College of Computer and Information Science 14-29

Discussion Questions (Page 1 of 2)

• Identify and discuss each of the six steps of programming.

• Describe CASE tools and OOP. How does CASE assist programmers?

• What is meant by “generation” in reference to programming languages? What is the difference between low-level and high-level languages?

Page 428

College of Computer and Information Science 14-30

Discussion Questions (Page 2 of 2)

• What is the difference between a compiler and an interpreter?

• What are logic structures? Describe the differences between the three logic types.

Page 428

College of Computer and Information Science 14-31

College of Computer and Information Science 14-32

End of Chapter 14