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