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