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