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