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