Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7...
-
Upload
sarah-chandler -
Category
Documents
-
view
214 -
download
0
Transcript of Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7...
![Page 1: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/1.jpg)
Slide 5-1 Copyright © 2003 Pearson Education, Inc.
Figure:
Computer Sciencean overview
EDITION 7
J. Glenn Brookshear
![Page 2: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/2.jpg)
Slide 5-2 Copyright © 2003 Pearson Education, Inc.
C H A P T E R 5
ProgrammingLanguages
![Page 3: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/3.jpg)
Slide 5-3 Copyright © 2003 Pearson Education, Inc.
Figure 5.1: Generations of programming languages
![Page 4: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/4.jpg)
Slide 5-4 Copyright © 2003 Pearson Education, Inc.
Figure 5.2: The evolution of programming paradigms
![Page 5: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/5.jpg)
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
![Page 6: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/6.jpg)
Slide 5-6 Copyright © 2003 Pearson Education, Inc.
Figure 5.4: The composition of a typical imperative program or program unit
![Page 7: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/7.jpg)
Slide 5-7 Copyright © 2003 Pearson Education, Inc.
Figure 5.5: The same variable declarations in different languages
![Page 8: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/8.jpg)
Slide 5-8 Copyright © 2003 Pearson Education, Inc.
Figure 5.6: A two-dimensional array with two rows and nine columns
![Page 9: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/9.jpg)
Slide 5-9 Copyright © 2003 Pearson Education, Inc.
Figure 5.7: Declaration of heterogeneous arrays in Pascal and C (continued)
![Page 10: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/10.jpg)
Slide 5-10 Copyright © 2003 Pearson Education, Inc.
Figure 5.7: Declaration of heterogeneous arrays in Pascal and C
![Page 11: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/11.jpg)
Slide 5-11 Copyright © 2003 Pearson Education, Inc.
Figure 5.8: Control struc-tures and their representations in C, C++, C#, and Java (continued)
![Page 12: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/12.jpg)
Slide 5-12 Copyright © 2003 Pearson Education, Inc.
Figure 5.8: Control struc-tures and their representations in C, C++, C#, and Java
![Page 13: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/13.jpg)
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)
![Page 14: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/14.jpg)
Slide 5-14 Copyright © 2003 Pearson Education, Inc.
Figure 5.9: The for loop structure and its representation in Pascal, C++, C#, and Java
![Page 15: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/15.jpg)
Slide 5-15 Copyright © 2003 Pearson Education, Inc.
Figure 5.10: The flow of control involving a procedure
![Page 16: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/16.jpg)
Slide 5-16 Copyright © 2003 Pearson Education, Inc.
Figure 5.11: The procedure Project Population written in the programming language C
![Page 17: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/17.jpg)
Slide 5-17 Copyright © 2003 Pearson Education, Inc.
Figure 5.12: Executing the procedure Demo and passing parameters by value (continued)
![Page 18: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/18.jpg)
Slide 5-18 Copyright © 2003 Pearson Education, Inc.
Figure 5.12: Executing the procedure Demo and passing parameters by value (continued)
![Page 19: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/19.jpg)
Slide 5-19 Copyright © 2003 Pearson Education, Inc.
Figure 5.12: Executing the procedure Demo and passing parameters by value
![Page 20: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/20.jpg)
Slide 5-20 Copyright © 2003 Pearson Education, Inc.
Figure 5.13: Executing the procedure Demo and passing parameters by reference (continued)
![Page 21: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/21.jpg)
Slide 5-21 Copyright © 2003 Pearson Education, Inc.
Figure 5.13: Executing the procedure Demo and passing parameters by reference (continued)
![Page 22: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/22.jpg)
Slide 5-22 Copyright © 2003 Pearson Education, Inc.
Figure 5.13: Executing the procedure Demo and passing parameters by reference
![Page 23: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/23.jpg)
Slide 5-23 Copyright © 2003 Pearson Education, Inc.
Figure 5.14: The function CylinderVolume written in the programming language C
![Page 24: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/24.jpg)
Slide 5-24 Copyright © 2003 Pearson Education, Inc.
Figure 5.15: An example of formatted output
![Page 25: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/25.jpg)
Slide 5-25 Copyright © 2003 Pearson Education, Inc.
Figure 5.16: The translation process
![Page 26: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/26.jpg)
Slide 5-26 Copyright © 2003 Pearson Education, Inc.
Figure 5.17: A syntax diagram of our if-then-else pseudocode statement
![Page 27: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/27.jpg)
Slide 5-27 Copyright © 2003 Pearson Education, Inc.
Figure 5.18: Syntax diagrams describing the structure of a simple algebraic expression
![Page 28: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/28.jpg)
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
![Page 29: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/29.jpg)
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)
![Page 30: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/30.jpg)
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)
![Page 31: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/31.jpg)
Slide 5-31 Copyright © 2003 Pearson Education, Inc.
Figure 5.21: An object-oriented approach to the translation process
![Page 32: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/32.jpg)
Slide 5-32 Copyright © 2003 Pearson Education, Inc.
Figure 5.22: The complete program preparation process
![Page 33: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/33.jpg)
Slide 5-33 Copyright © 2003 Pearson Education, Inc.
Figure 5.23: The structure of a class describing a laser weapon in a computer game
![Page 34: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/34.jpg)
Slide 5-34 Copyright © 2003 Pearson Education, Inc.
Figure 5.24: A class with a constructor
![Page 35: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/35.jpg)
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
![Page 36: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/36.jpg)
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)
![Page 37: Slide 5-1 Copyright © 2003 Pearson Education, Inc. Figure: Computer Science an overview EDITION 7 J. Glenn Brookshear.](https://reader035.fdocuments.in/reader035/viewer/2022070305/5514721d5503462d4e8b60da/html5/thumbnails/37.jpg)
Slide 5-37 Copyright © 2003 Pearson Education, Inc.
Figure 5.27: Resolving the statements (P OR Q), (R OR Q), R, and P