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