Presentation is loading. Please wait.

Presentation is loading. Please wait.

Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.

Similar presentations


Presentation on theme: "Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear."— Presentation transcript:

1 Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear

2 Slide 5-2 Copyright © 2003 Pearson Education, Inc. C H A P T E R 5 Programming Languages

3 Slide 5-3 Copyright © 2003 Pearson Education, Inc. Figure 5.1: Generations of programming languages

4 Slide 5-4 Copyright © 2003 Pearson Education, Inc. Figure 5.2: The evolution of programming paradigms

5 Slide 5-5 Copyright © 2003 Pearson Education, Inc. Figure 5.3: A function that computes the average of a list of numbers constructed from the simpler functions Sum, Count, and Divide

6 Slide 5-6 Copyright © 2003 Pearson Education, Inc. Figure 5.4: The composition of a typical imperative program or program unit

7 Slide 5-7 Copyright © 2003 Pearson Education, Inc. Figure 5.5: The same variable declarations in different languages

8 Slide 5-8 Copyright © 2003 Pearson Education, Inc. Figure 5.6: A two-dimensional array with two rows and nine columns

9 Slide 5-9 Copyright © 2003 Pearson Education, Inc. Figure 5.7: Declaration of heterogeneous arrays in Pascal and C (continued)

10 Slide 5-10 Copyright © 2003 Pearson Education, Inc. Figure 5.7: Declaration of heterogeneous arrays in Pascal and C

11 Slide 5-11 Copyright © 2003 Pearson Education, Inc. Figure 5.8: Control struc- tures and their representations in C, C++, C#, and Java (continued)

12 Slide 5-12 Copyright © 2003 Pearson Education, Inc. Figure 5.8: Control struc-tures and their representations in C, C++, C#, and Java

13 Slide 5-13 Copyright © 2003 Pearson Education, Inc. Figure 5.9: The for loop structure and its representation in Pascal, C++, C#, and Java (continued)

14 Slide 5-14 Copyright © 2003 Pearson Education, Inc. Figure 5.9: The for loop structure and its representation in Pascal, C++, C#, and Java

15 Slide 5-15 Copyright © 2003 Pearson Education, Inc. Figure 5.10: The flow of control involving a procedure

16 Slide 5-16 Copyright © 2003 Pearson Education, Inc. Figure 5.11: The procedure Project Population written in the programming language C

17 Slide 5-17 Copyright © 2003 Pearson Education, Inc. Figure 5.12: Executing the procedure Demo and passing parameters by value (continued)

18 Slide 5-18 Copyright © 2003 Pearson Education, Inc. Figure 5.12: Executing the procedure Demo and passing parameters by value (continued)

19 Slide 5-19 Copyright © 2003 Pearson Education, Inc. Figure 5.12: Executing the procedure Demo and passing parameters by value

20 Slide 5-20 Copyright © 2003 Pearson Education, Inc. Figure 5.13: Executing the procedure Demo and passing parameters by reference (continued)

21 Slide 5-21 Copyright © 2003 Pearson Education, Inc. Figure 5.13: Executing the procedure Demo and passing parameters by reference (continued)

22 Slide 5-22 Copyright © 2003 Pearson Education, Inc. Figure 5.13: Executing the procedure Demo and passing parameters by reference

23 Slide 5-23 Copyright © 2003 Pearson Education, Inc. Figure 5.14: The function CylinderVolume written in the programming language C

24 Slide 5-24 Copyright © 2003 Pearson Education, Inc. Figure 5.15: An example of formatted output

25 Slide 5-25 Copyright © 2003 Pearson Education, Inc. Figure 5.16: The translation process

26 Slide 5-26 Copyright © 2003 Pearson Education, Inc. Figure 5.17: A syntax diagram of our if-then-else pseudocode statement

27 Slide 5-27 Copyright © 2003 Pearson Education, Inc. Figure 5.18: Syntax diagrams describing the structure of a simple algebraic expression

28 Slide 5-28 Copyright © 2003 Pearson Education, Inc. Figure 5.19: The parse tree for the string x + y z based on the syntax diagrams in Figure 5.18

29 Slide 5-29 Copyright © 2003 Pearson Education, Inc. Figure 5.20: Two distinct parse trees for the statement if B1 then if B2 then S1 else S2 (continued)

30 Slide 5-30 Copyright © 2003 Pearson Education, Inc. Figure 5.20: Two distinct parse trees for the statement if B1 then if B2 then S1 else S2 (continued)

31 Slide 5-31 Copyright © 2003 Pearson Education, Inc. Figure 5.21: An object-oriented approach to the translation process

32 Slide 5-32 Copyright © 2003 Pearson Education, Inc. Figure 5.22: The complete program preparation process

33 Slide 5-33 Copyright © 2003 Pearson Education, Inc. Figure 5.23: The structure of a class describing a laser weapon in a computer game

34 Slide 5-34 Copyright © 2003 Pearson Education, Inc. Figure 5.24: A class with a constructor

35 Slide 5-35 Copyright © 2003 Pearson Education, Inc. Figure 5.25: Our LaserClass definition using encapsulation as it would appear in a Java or C# program

36 Slide 5-36 Copyright © 2003 Pearson Education, Inc. Figure 5.26: Resolving the statements (P OR Q) and (R OR Q) to produce (P OR R)

37 Slide 5-37 Copyright © 2003 Pearson Education, Inc. Figure 5.27: Resolving the statements (P OR Q), (R OR Q), R, and P


Download ppt "Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear."

Similar presentations


Ads by Google