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