Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 804 Bytes

3.05.md

File metadata and controls

16 lines (13 loc) · 804 Bytes

Hands-on Exercise #5

Building on the code from the previous example

  1. at the package level scope, using the var keyword, create a VARIABLE with the IDENTIFIER y. The variable should be of the UNDERLYING TYPE of your custom type x.
  2. in func main a. this should already be done
    • print out the value of the variable x
    • print out the type of the variable x
    • assign your own VALUE to the VARIABLE x using the = OPERATOR
    • print out the value of the variable x b. now do this
    • now use CONVERSION to convert the TYPE of the VALUE stored in x to the UNDERLYING TYPE
      1. then use the short declaration operator to ASSIGN that value to y

answer