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