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