From the course: Programming for Non-Programmers: Android & Kotlin
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Create two variables
From the course: Programming for Non-Programmers: Android & Kotlin
Challenge: Create two variables
- [Instructor] Now for a challenge based on what you've learned so far in this chapter. Before the challenge, let's do a review of what variables are. They're the nouns or the things of programming. They're named containers that hold data. And data could be text, numbers, or other data types. They could be simple, numeric values, all the way to complex values, and you could even create custom data types for variables, as well. In code, a variable looks like this. The var keyword, the name of the variable, and then the value of the variable. And now for the challenge. I want you to put the text "My cat Diane is 3 years old" inside of a textView. Now, it may sound easy, but no cheating. I want you to use variables for the name and the age. So Diane should be coming from a variable and three should come from a variable, as well. This challenge should take about 10 minutes to complete.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
How programming works3m 58s
-
(Locked)
Variables3m 33s
-
(Locked)
Working with variables5m
-
(Locked)
Using properties2m 53s
-
(Locked)
Connect visual objects to variables6m 39s
-
(Locked)
Enum values5m 30s
-
(Locked)
Private properties and constants4m 53s
-
(Locked)
Practical applications of variables2m 22s
-
(Locked)
Challenge: Create two variables1m 9s
-
(Locked)
Solution: Create two variables2m 41s
-
-
-
-
-
-