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