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