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