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