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