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