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