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