๐งชVariables LabLAB
Variables Lab
In this lab, you will declare variables for a user profile and print them using formatted output.
Your Task
Declare the following:
Constants (use const or a const block with iota):
maxConnectionsโ a constant int set to100- A
Roleconst block usingiota:Guest = iota,User,Admin(values 0, 1, 2)
Variables:
nameโ astringrepresenting the user's name (e.g.,"Alice")ageโ anintrepresenting the user's age (e.g.,25)countryโ astringrepresenting the user's country (e.g.,"Vietnam")isStudentโ aboolrepresenting whether the user is a student (e.g.,true)roleโ assign it the valueAdmin
Then print everything so the output looks like:
Format Verbs
Use these fmt.Printf format verbs:
%sโ for strings%dโ for integers%vโ for booleans (or any value)
Example
โ Enter (Mac) ยท Ctrl+Enter (Win/Linux)
โ Enter (Mac) ยท Ctrl+Enter (Win/Linux)