Variables, primitives (ex. 01)

This exercise is meant to give you a basic understanding of primitive variables.

Create variables

Create the following four variables:

  • forename (String)
  • surname (String)
  • age (int)
  • learning (Boolean)

Give the variables relevant content, and compose a trace() statement, that mixes the variables with literal text.

Create Integers

  1. Create two variables called positive and negative of the type uint and int.
  2. Give them both the value of -5
  3. Send them to the output panel with a trace() statement, and pay attention to the value that unsigned integer gives.

Numbers and rounding

  1. Create two variables called floating and integer of the type Number and int.
  2. Give them both the value of 1.234
  3. Send dem til output panelet med en
  4. Send them to the output panel with a trace() statement, and pay attention to the rounding of the integer.
  5. Give the variable integer the value 12 (after the trace) and send it again to the output window.

References

Variables

Datatypes

Syntax

String, Number, int, uint, Boolean