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