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