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