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