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