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