The POGIL materials
-
Expression Evaluation: Order of operations and arithmetic
- Model #1 -
Precedence table with arithmetic operators
- #7 (how do we apply the order of ops? by
following what's in the table)
- #8 - evaluate a new expression. Make
sure they write out the intermediate steps in the right
order.
- Model #2 -
- #4 (artciiulate how we apply precedence, now with
comparison operators)
- #5 (evaluate a new expression. Make
sure they write out the intermediate steps in the right
order.
- Expression Evaluation: Associativity
- Model #1 - Addition, mult associativity
- #4 / 5 - for the mult, addition, which goes first &
why (left to right, because that's what the table says)
- Model #2 - multiple (right to left) assignment
- #4 - why does the right-most assignment go first?
(because table says so)
- #5 - why did the language designer decide to do
this? So we can do multiple assignment
- Exercise #1 - figure out the ORDER THAT the expression
from hell get evaluated in
- Output (via placeholders)
- For Model #1: (basic C.WL(a); )
- #3 (Console.WriteLine prints the thing it's given)
- #4/5/6: We're omitting the code because it always
does the same thing (the program may do other stuff
ahead/behind it)
- For Model #2 (C.WL with a single placeholder)
- #4 - {0} means subsitute the first thing in the list
of var args
- Model #3 (C.WL with multiple placeholders)
- #4 - {N} means take the N+1th thing in the list ({0}
means take the first thing, {1} means take the second -
just like an array)
- #5 - predict output
- #6 - Using {N}, where there aren't N+1 args.
This doesn't work. It'll crash but they're not
expected to know or guess this
- #7 - create a line of output that prints out some
specific output
- Model #4 - C.WL vs. C.W
- #6 - what output is produced, given C.WL and C.W
- Model #5 - string concatentation
- #4 - In general, what does + do?
- #7 - When does + mean concatenation vs. addition?
- #8 - example of using concat
- #9 - pros & cons of concat vs. placeholder
- Model #6 - string interpolation
- #6 - example of using string interpolation
- #7 - pros & cons of three approaches
Instructor's Materials:
Notes
These notes are for the instructor’s use, and not meant for public consumption.
They're posted here on the off chance that you find them useful - If they help you, that’s great.
If not, please just ignore them :)
Display: none
to hide notes
Improvements for next time:
- F'ing page wasn't updated for 2018 Spring, so I ended up
using the old version (with just the first model) for 2018
Spring. Ugh!!!
- Some of the students might actually benefit from some
review. For that table in back I'm not 100% sure that they
understood what the assignment operator did.
- IDEA: How about the op. prec. exercise leads with "how would
you evaluate this expression: x + 2 * y * 3?", to fish for the
'PEMDAS' answer. Then give them something like if( x < 2
&& y < 3) w/ a brief explanation about what the && (AND) does?)
Improved for this time:
-
DONE:
Expression Evaluation: Order of operations and arithmetic
// add 2nd example with comparison (non-math) operators.
Maybe show an if() statement, and then ask them to evaluate the
inside of it. (leave out data type annotations, but include a
brief note about data types?)
- DONE: IDEA: Instead, start by showing the
final, mega-weird expression, and explain that the goal is to
understand how to use the precedence table well enough to
predict the order
- DONE: - FIX
M#1-Q#7
- DONE: Spent a ton of time on the output (placeholder) one, didn't
get to the others, didn't get as much time as I'd like on the
expression eval.
IDEA: Start with expressions, then go on to
I/O as time permits
- DONE: // figure out how to force page
breaks to ensure that each model starts on it's own page?
NO LONGER MAINTAINED:
In-Class
Videos (These were
recorded during this
class, and are made
available here in
case you want to
refer to them later)