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