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