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