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