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