App Dev Worksheet: Variables, Lists and Saving
Developer's tip (Box, list, place): A variable holds one value; a list holds many in order. Positions start at 0. push adds to the end; pop takes off the last item; length is how many items. On the phone: works offline, private. In the cloud: shared, any device, needs the internet.
NameDateTime takenScore ___ / 40
- 1.True or false: chat messages to friends fits saving in the cloud. (a) True (b) False
- 2.💾 Where should the app save chat messages to friends: on the phone or in the cloud? (a) on the phone (b) in the cloud
-
3.💾 What does this code show? (Positions start at 0.)
let notes = ["Sports", "Art", "Music", "Maths", "Hindi"];
show(notes[0]); (a) Sports (b) Maths (c) Art (d) Music - 4.Which of these fits saving on the phone? (a) chat messages to friends (b) notes to read offline (c) a shared to-do list (d) a class leaderboard
-
5.💾 pop() takes off the last item. What does this code show?
let notes = ["Music", "Art", "Science", "Sports", "Hindi"];
notes.pop();
show(notes[notes.length - 1]); (a) Sports (b) Art (c) Music (d) Science -
6.💾 What number does this code show?
let stars = 6;
stars = stars - 3;
stars = stars + 4;
show(stars); - 7.💾 Where should the app save your last game level: on the phone or in the cloud? (a) in the cloud (b) on the phone
- 8.True or false: a draft you are typing fits saving on the phone. (a) True (b) False
-
9.💾 What number does this code show?
let songs = ["Kites", "Stars"];
songs.push("Ocean");
songs.push("Sunrise");
show(songs.length); -
10.💾 What number does this code show?
let notes = ["Music", "Maths"];
notes.push("Science");
notes.push("Hindi");
show(notes.length); -
11.💾 What number does this code show?
let songs = ["Sunrise", "Ocean"];
songs.push("Stars");
show(songs.length); -
12.💾 What does this code show? (Positions start at 0.)
let notes = ["Science", "Hindi", "Art"];
show(notes[0]); (a) Art (b) Science (c) Hindi - 13.True or false: photos on two devices fits saving on the phone. (a) False (b) True
- 14.True or false: a shared to-do list fits saving on the phone. (a) True (b) False
-
15.💾 What number does this code show?
let songs = ["Ocean", "Monsoon", "Kites"];
songs.push("Rain");
show(songs.length); - 16.💾 What is a variable? (a) a picture (b) a phone setting (c) a named box for a value (d) a type of screen
-
17.💾 pop() takes off the last item. What does this code show?
let songs = ["Ocean", "Rain", "Monsoon", "Sunrise", "Kites"];
songs.pop();
show(songs[songs.length - 1]); (a) Rain (b) Ocean (c) Sunrise (d) Monsoon - 18.💾 Where should the app save a draft you are typing: on the phone or in the cloud? (a) in the cloud (b) on the phone
- 19.💾 Saving data in the cloud lets you ___. (a) use it on any device (b) never need a password (c) shrink the app (d) skip the internet
-
20.💾 What number does this code show?
let lives = 3;
lives = lives - 1;
lives = lives + 1;
show(lives); - 21.💾 Where should the app save photos on two devices: on the phone or in the cloud? (a) on the phone (b) in the cloud
- 22.True or false: notes to read offline fits saving on the phone. (a) True (b) False
-
23.💾 What does this code show? (Positions start at 0.)
let notes = ["Maths", "Hindi", "Art", "Music"];
show(notes[3]); (a) Maths (b) Art (c) Hindi (d) Music - 24.Which of these fits saving in the cloud? (a) a draft you are typing (b) your last game level (c) notes to read offline (d) chat messages to friends
- 25.Which of these fits saving on the phone? (a) a shared to-do list (b) a class leaderboard (c) the sound on/off setting (d) photos on two devices
- 26.True or false: your last game level fits saving in the cloud. (a) True (b) False
-
27.💾 What number does this code show?
let songs = ["Kites", "Rain"];
songs.push("Ocean");
songs.push("Stars");
show(songs.length); - 28.💾 Where should the app save the sound on/off setting: on the phone or in the cloud? (a) in the cloud (b) on the phone
- 29.True or false: the sound on/off setting fits saving in the cloud. (a) True (b) False
- 30.True or false: notes to read offline fits saving in the cloud. (a) True (b) False
-
31.💾 What number does this code show?
let friends = ["Riya", "Zoya"];
friends.push("Meera");
show(friends.length); -
32.💾 What number does this code show?
let notes = ["Science", "Maths", "Art", "Hindi"];
notes.push("Music");
show(notes.length); - 33.True or false: a class leaderboard fits saving on the phone. (a) False (b) True
- 34.Which of these fits saving in the cloud? (a) a draft you are typing (b) the sound on/off setting (c) your last game level (d) photos on two devices
- 35.💾 Data saved only on the phone is lost when ___. (a) you send a message (b) the app is closed (c) the screen turns off (d) the phone is lost
-
36.💾 pop() takes off the last item. What does this code show?
let songs = ["Rain", "Monsoon", "Sunrise"];
songs.pop();
show(songs[songs.length - 1]); (a) Rain (b) Sunrise (c) Monsoon - 37.💾 Which can hold many values in order? (a) a single number (b) a list (c) a button (d) a switch
-
38.💾 What number does this code show?
let notes = ["Maths", "Science"];
notes.push("Hindi");
show(notes.length); - 39.True or false: a shared to-do list fits saving in the cloud. (a) False (b) True
-
40.💾 What number does this code show?
let points = 5;
points = points - 3;
points = points + 5;
show(points);
Answer key
- True
- in the cloud
- Sports
- notes to read offline
- Sports
- 7
- on the phone
- True
- 4
- 4
- 3
- Science
- False
- False
- 4
- a named box for a value
- Sunrise
- on the phone
- use it on any device
- 3
- in the cloud
- True
- Music
- chat messages to friends
- the sound on/off setting
- False
- 4
- on the phone
- False
- False
- 3
- 5
- False
- photos on two devices
- the phone is lost
- Monsoon
- a list
- 3
- True
- 7
Free app development lessons, practice and worksheets at talentjr.in/app-development-for-students