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