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