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