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