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