Skip to main content

Section 2.5 Evaluate Expressions-WE2-P1

Subgoals for evaluating an assignment statement.

  1. Decide order of operations
    1. Decompose as necessary
  2. Determine operator behavior based on operands
    1. Operator and operands must be compatible
  3. Solve arithmetic, expression, or operation
    1. Decompose as necessary

Subsection 2.5.1

For all given problems below indicate if the code is valid or invalid. Each problem is independent of the others (e.g. Question 2 does not depend on Question 1, only the β€œGiven” code).

Subsection 2.5.2 Evaluate Expressions-WE2-P1

alpha = 2
beta = 1
delta = '3.0'
theta = -1.3

Exercises Exercises

You have attempted 1 of 6 activities on this page.