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