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