Assignment

November 4, 2020 ยท View on GitHub

The Concept

An assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assignment statement (or expression) is a fundamental construct.

What to cover

  • How to assign values How to assign a value to a variable.
  • How to update a value How to update a variable's value.

Exercises

Lasagna cooking

This exercise deals with cooking a lasagna dish in the oven. The reference implementation (C#) teaches:

  • How to assign a value to a variable.
  • How to update a variable's value.

Implementations

TrackExerciseChanges
C#lucians-luscious-lasagnaNone
ElixirbasicsIntroduces binding values rather than assignment
JavaScriptbasicsThere is no updating of a variable
F#lucians-luscious-lasagnaThere is no updating of a variable
Rubybasics