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