C++程序设计课件:Chapter1 Overview of Programming and Problem Solving_第1页
C++程序设计课件:Chapter1 Overview of Programming and Problem Solving_第2页
C++程序设计课件:Chapter1 Overview of Programming and Problem Solving_第3页
C++程序设计课件:Chapter1 Overview of Programming and Problem Solving_第4页
C++程序设计课件:Chapter1 Overview of Programming and Problem Solving_第5页
已阅读5页,还剩21页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、11/29/2021C+程序设计 教师:1C+程序设计(1)11/29/2021C+程序设计 教师:2课程介绍nC+基础知识(类,模版)nMicrosoft Visual C+ 6.0nVC+6 guide.pdf nVC 6 IDE 介绍11/29/2021C+程序设计 教师:3An Examplen#include nint main()nncouthello,world!;nreturn 0;n11/29/2021C+程序设计 教师:4考核方式n期末闭卷考核占50% necnucpp平台考核,出勤等平时成绩占50% 11/29/2021C+程序设计 教师:5参考书目书名:书名:C+C+程

2、序设计语言程序设计语言 英文书名:英文书名:The C+ Programming LanguageThe C+ Programming Language作者:作者:Bjarne StroustrupBjarne Stroustrup11/29/2021C+程序设计 教师:6参考书目书名:书名:C+ C+ 编程思想(编程思想(2nd2nd)英文书名:英文书名:Thinking in C+(Second Edition)Thinking in C+(Second Edition)作者:作者:Bruce EckelBruce Eckel11/29/2021C+程序设计 教师:7参考书目书名:书名:C

3、+ Primer 英文书名:英文书名:C+ Primer 作者:作者:Lippman11/29/2021C+程序设计 教师:8参考书目书名:书名:Effective C+ 英文书名:英文书名:Effective C+ 作者:作者:Scott Meyers译者:译者:侯捷侯捷11/29/2021C+程序设计 教师:9参考书目书名:书名:More Effective C+英文书名:英文书名:More Effective C+:35 New Ways to Improve Your Programs and Designs作者:作者:Scott Meyers译者:译者:侯捷侯捷11/29/2021C

4、+程序设计 教师:10Chapter1OverviewofProgrammingandProblemSolvingn1.1 Overview of ProgrammingnComputer Program a sequence of instructions to be performed by a computer.nComputer Programming the process of planning a sequences of steps for a computer to follow.nThe computer allows us to do tasks more efficie

5、ntly, quickly and accurately.11/29/2021C+程序设计 教师:11Programs life cycle1. Problem-Solving Phase (requirement analysis and specification; algorithm design)nAlgorithmA step-by-step procedure for solving a problem in a finite amount of time.2. Implementation Phase (coding; debugging; testing)3. Maintena

6、nce Phase (using; correct; improving)nIterative procedure. nProgram commentsnDocumentation11/29/2021C+程序设计 教师:12Two Algorithm ExamplesBOOK P41.Start your car.2.Determine an employees weekly wages.11/29/2021C+程序设计 教师:13From Algorithm to Program11/29/2021C+程序设计 教师:14From Algorithm to ProgramnProgrammi

7、ng language:nA set of rules, symbols, and special words used to construct a computer program.nC+ is an example of Programming Language.nOthers: JAVA, C#, Pascal, BASICnTranslating an algorithm into a programming language is called coding the algorithm.nThe combination of coding and testing an algori

8、thm is called implementation.11/29/2021C+程序设计 教师:15Determine an employees weekly wages.nSource file : PAYROLL.CPPnExecution file : payroll.exenExample Under Folder Payroll11/29/2021C+程序设计 教师:16Program Executioninput dataprogramoutputdata11/29/2021C+程序设计 教师:17程序调试debugging的一些方法n可能的程序分支都思考一遍可能的程序分支都思考

9、一遍n在主程序的关键点添加重要变量输出语句或设置断点在主程序的关键点添加重要变量输出语句或设置断点n在函数的调用前后添加重要变量输出语句或设置断点在函数的调用前后添加重要变量输出语句或设置断点11/29/2021C+程序设计 教师:18软件测试testingn测试只能证明BUG的存在,永远不能证明BUG的不存在。n测试的主要方法n黑盒法n白盒法11/29/2021C+程序设计 教师:19Language CategorynMachine language binary formnLow-level language Assembly language nHigh-level language

10、C+, PascalnNatural language English, French, Germann11/29/2021C+程序设计 教师:20From Source Program to Object ProgramobjectsourceCompilerSource program: A program written in a high-level programming language.Compiler: A program that translates a high-level language into machine code.Object program: The ma

11、chine language version of a source program.BOOK P7 Figure 1-3A computer can do: P811/29/2021C+程序设计 教师:21C+ CompilersnMicrosoft Visual C+nBorland C+nLinux GNU C+nnISO/ANSI Standard C+11/29/2021C+程序设计 教师:22Four Basic control structuresnSequentiallynConditionallynRepetitivelynWith subprograms (Divide a

12、nd Conquer)nBOOK P10 Figure1-611/29/2021C+程序设计 教师:23Computer SystemnHardware(P11 Figure 1-7)nCPUnALU Perform arithmetic and logical operations.nControl unit controls the actions of the other components.nMemorynI/O devicenPeripheral devicenSoftwarenOperating SystemnA set of programs that manages all

13、of the computers resources.nApplication11/29/2021C+程序设计 教师:24Problem-SolvingTechniquesnAsk QuestionsnLook for Things That Are FamiliarnSolve by AnalogynMeans-Ends AnalysisnDivide and Conquer(Functional Decomposition-FD, Object-oriented Design-OOD)nThe Building-Block ApproachnMerging SolutionsnRewriting the problem in your own words11/29/

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论