Chapter 14 Programming and Languages College of Computer and Information Science 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-2 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-3 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-4 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-5 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-6 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-7 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-8 Programs and Programming • What is a Program? • A problem-solving procedure – A list of instructions • • • • Page 400 Prewritten Custom-written Application software System software College of Computer and Information Science 14-9 What is Programming? • • Programming is software development Six step procedure – – – – – – Page 400 Program specification Program design Program code Program test Program documentation Program maintenance College of Computer and Information Science 14-10 Step 1: Program Specification • • Also called programs definition or program analysis 5 Step Process – – – – – Page 401 Program Objectives Desired Output Input Data Processing Requirements Document Program Specifications College of Computer and Information Science 14-11 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 Return Page 401 College of Computer and Information Science 14-12 Program Specification Steps Continued • Desired output • Input Data • Processing Requirements • Program Specifications Document End user’s sketch of desired output Example of statement of hours worked Page 402 College of Computer and Information Science 14-13 Step 2: Program Design • Plan a solution • Use structured programming techniques – – – – Page 403 Top-down program design Pseudocode Flowcharts Logic structures College of Computer and Information Science 14-14 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-19 Coding • Formatting or presentation language • Programming language Page 408 College of Computer and Information Science 14-20 Step 4: Program Test • Debugging – Testing – Eliminating errors • Syntax errors • Logic errors • Testing process Page 422 College of Computer and Information Science 14-21 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-22 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-23 Case Tools • Computer-aided software engineering (CASE) – Automate development process • Designing • Coding • Testing activities Page 414 College of Computer and Information Science 14-24 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-25 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-26 Generations of Programming Languages (Page 2 of 2) • • • • • Page 415 1st -- Machine languages 2nd -- Assembly languages 3rd -- High level procedural languages (3GL) 4th -- Problem-Oriented languages (4GL) 5th -- Natural Languages & Visual programming languages (5GL) College of Computer and Information Science 14-27 Language Translators • compiler compiling linking resource code========>.obj=======>.exe • interpreter College of Computer and Information Science 14-28 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-29 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-30 College of Computer and Information Science 14-31 Crossword Puzzle Answers: Across Num. Down Clue Answer Num. Clue Answer 1 Writing a program. Coding 1 Converts procedural language into machine language code. Compiler 6 A list of instructions for the computer to follow. Program 2 Error that is a violation of the rules of a programming language. Syntax 9 Represent the steps needed to solve a programming problem. Program flowchart 3 The final step in testing a program. Beta testing 10 Programmer that ensures current programs remain error free. Maintenance 4 Software engineer. Programmer 12 The problem a user is trying to solve. Objective 5 Sequence, selection, and loop. Logic structure 13 Structure that describes a process that may be repeated while a condition is true. Loop 7 Processing steps used in top-down program design. Module 8 Logic Testing and then eliminating errors. Debugging Error that occurs when an incorrect calculation is used. 9 Outline of the logic of the program you will write. Pseudocode 11 Process by which a program is organized into objects. OOP 14 15 Tools that provide some automation in program design, coding, and testing. CASE College of Computer and Information Science 14-32 Answers for Multiple Choice and Matching Num Multiple Choice Answers Matching Answers 1 A I 2 B H 3 C G 4 B J 5 C D 6 B B 7 B C 8 C E 9 D F 10 B A College of Computer and Information Science 14-33 End of Chapter 14 College of Computer and Information Science 14-34