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