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