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