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