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