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