Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Similar presentations


Presentation on theme: "Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."— Presentation transcript:

1 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Chapter 4 Compound Expressions

2 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Overview

3 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Function Composition

4 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Function Composition By using function composition, we can combine all of those steps into a single line:

5 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Function Composition

6 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Expression Tree Evaluation

7 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Method Chaining

8 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Method Chaining The same thing can be accomplished using method chaining:

9 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Method Chaining Expression Tree

10 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Operator Precedence

11 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Operator Precedence

12 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Operator Precedence

13 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Short-Circuit Evaluation

14 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Short-Circuit Evaluation

15 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Short-Circuit Evaluation or short-circuits (colored red) if the first operand is True.

16 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Short-Circuit Evaluation and short-circuits (colored red) if the first operand is False

17 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Last-Value Evaluation

18 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Last-Value Evaluation Try these examples. Based on last-value evaluation, what should they print?

19 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Augmented Assignment Operators

20 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Augmented Assignment Operators

21 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Augmented Assignment Statement

22 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. String Formatting Implicit Order Explicit Order Named Order

23 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Format Operations

24 Copyright © 2014 Dr. James D. Palmer; http://jdpalmer.org/cs1 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Format Operations


Download ppt "Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."

Similar presentations


Ads by Google