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