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