Chapter 3 : Variables
Seems like you have locked-in the parameters. You should unlock them so we can later change the ship configuration if need be.
Constants are immutable by design, which means their values cannot be reassigned. Put in another way, they can be assigned once, at their declaration. When defining a constant you need to provide a name, type and a value:
const age: int = 25;
Variables, unlike constants, are mutable. They cannot be declared in a global scope, but they can be declared and used within functions, or as function parameters.
var c: int := 2 + 3
c := c – 3
⚠️ Notice the assignment operator := for var, instead of = for constants.
1- In the top right editor, modify the code from the previous chapter to make my_ship a variable.
2- On the next line, modify its value to “222031”
Type your solution above and validate your answer