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