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