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