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