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