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