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