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