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