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