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