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