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