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