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