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