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