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