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

Challenge: Create two variables

From the course: Programming for Non-Programmers: Android & Kotlin

Start my 1-month free trial

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.

Contents