学习日记(foundation-computer)

 继续c++之旅


Chapter 4:PROGRAMMING SOLVING PROCESS(Pseudocode & Flowchart)
  • Input, Process and Output
-Three steps that a program typically performs:
  1. gather input
  2. process the input
  3. display the result
  • Problem Solving Methods
-Three problem solving methods :
  1. Flowchart(Develop Algorithms)
  2. Pseudo code(Develop Algorithms)
  3. Structured Chart(Top-down design)
  • Algorithms
- 排列的有限步骤数序列以特定的逻辑顺序为问题。
-requirements
。Must have input
。Must produce output
。Unambiguous
。Generality
。Correctness
。Finiteness
。Efficiency
  • Pseudo Code
-半正式的,类似英语的语言,具有可以用来设计和描述的词汇量有限算法。
-目的:以一种简单,易于理解的方式定义算法的程序逻辑。
-没有编程语言的语法复杂性。
  • Flowchart
-以图形符号表示算法。
-的几何形状图通过线连接。
-2个重要的element
。Geometrical shapes – represent type of statements in the algorithm
。Flow line – show the order in which the statements of an algorithm
are executed.

  • Flowchart for Program Structures
-描述执行流程
-Basic types of control structure:
。Sequential
*一系列步骤或语句,按照它们在算法中的写入顺序执行。
*Pseudo code -标记一个块的开始和结束陈述。
*Multiple statements considered as one statement.
。Selection
*选择允许您在两个或多个备选方案之间进行选择。 那就是让您做出决定。
*计算机做出的决定必须非常简单,因为计算机中的所有内容最终都会减少为TRUE(1)或FALSE(0)。
*如果需要复杂的决策,则程序员的工作就是将其简化为计算机可以处理的一系列简单决策。
。Repetition
*指定一个或多个重复执行直到满足条件的语句的块。
*2个重要的part
》经过测试的是非判断表达式,
》只要表达式是重复的语句或块真正
*2个loop
》Pre-test loop
》Post test loop

还是有点看不太走,没事等下读完了在上网看一遍~

评论

此博客中的热门博文

梦日记77

麻木,但是好像男友代餐

书&剧日记,吃货日记和精油日记