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