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