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