正在加载图片...
VI Contents 8.3.4 Nested Loops… 244 8.4 Computing with Booleans......... 246 84.1 Boolean Operators 246 8.4.2 B00 lean Algebra3… 250 8.5 Other Common Structures. 251 8.5.1P0st-Test L00p… 251 8.5.2 Loop and a Half.… 254 8.5.3 Boolean Expressions as Decisions..... 254 8.6 Chapter Summary… 258 8.7 Exercises..… 259 Chapter 9 Simulation and Design 265 9.1 Simulating Racquetball......................... 265 9.1.1 A Simulation Problem.......... 266 9.1.2 Analysis and Specification........... 266 9.2 PseudoRandom Numbers........ 268 9.3 Top-Down Design.................. 270 9.2.1 Top-Level Design.......... 271 9.2.2 Separation of Concerns 273 9.2.3 Second-Level Design................ 273 9.2.4 Designing simNGames… 275 92.5 Third--Level Design… 277 9.2.6 Finishing Up.......... 280 9.2.7 Summary of the Design Process 282 9.4 Bottom-Up Implementation ............... 283 9.4.1 Unit Testing........... 283 9.4.2 Simulation Results 285 9.5 Other Design Techniques.. 286 9.5.1 Prototyping and Spiral Development 286 9.5.2 The Art of Design............... 288 9.6 Chapter Summary… 288 9.7 Exercises5.… 289 Chapter 10 Defining Classes 295 10.1 Quick Review of Objects.......... 295 10.2 Example Program:Cannonball......... 296 10.2.1 Program Specification.......... 296 10.2.2 Designing the Program 297 10.2.3 Modularizing the Program.... 301 10.3 Defining New Classes............ 303 10.3.1 Example:Multi-Sided Dice... 303 10.3.2 Example:The Projectile Class... 307 10.4 Data Processing with Class........ 309 10.5 Objects and Encapsulation ... 313 10.5.1 Encapsulating Useful Abstractions 44 313 10.5.2 Putting Classes in Modules... 315vi Contents 8.3.4 Nested Loops 244 8.4 Computing with Booleans 246 8.4.1 Boolean Operators 246 8.4.2 Boolean Algebra 250 8.5 Other Common Structures 251 8.5.1 Post-Test Loop 251 8.5.2 Loop and a Half 254 8.5.3 Boolean Expressions as Decisions 254 8.6 Chapter Summary 258 8.7 Exercises 259 Chapter 9 Simulation and Design 265 9.1 Simulating Racquetball 265 9.1.1 A Simulation Problem 266 9.1.2 Analysis and Specification 266 9.2 PseudoRandom Numbers 268 9.3 Top-Down Design 270 9.2.1 Top-Level Design 271 9.2.2 Separation of Concerns 273 9.2.3 Second-Level Design 273 9.2.4 Designing simNGames 275 9.2.5 Third-Level Design 277 9.2.6 Finishing Up 280 9.2.7 Summary of the Design Process 282 9.4 Bottom-Up Implementation 283 9.4.1 Unit Testing 283 9.4.2 Simulation Results 285 9.5 Other Design Techniques 286 9.5.1 Prototyping and Spiral Development 286 9.5.2 The Art of Design 288 9.6 Chapter Summary 288 9.7 Exercises 289 Chapter 10 Defining Classes 295 10.1 Quick Review of Objects 295 10.2 Example Program: Cannonball 296 10.2.1 Program Specification 296 10.2.2 Designing the Program 297 10.2.3 Modularizing the Program 301 10.3 Defining New Classes 303 10.3.1 Example: Multi-Sided Dice 303 10.3.2 Example: The Projectile Class 307 10.4 Data Processing with Class 309 10.5 Objects and Encapsulation 313 10.5.1 Encapsulating Useful Abstractions 313 10.5.2 Putting Classes in Modules 315
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有